### Question:
ConditionASTNodeConverter implements ASTNodeConverter<WebDriverActionCondition, WebDriverActionConfiguration> { @Override public WebDriverActionConfiguration convert(WebDriverActionCondition webDriverActionCondition) { WebDriverActionConfiguration webDriverActionConfiguration = new WebDriverActionConfiguration(); webDriverActionConfiguration.setWebDriverActionType(webDriverActionCondition.eClass().getName()); Map<String, ParameterConfiguration> configurationMap = parametersConfigurationConverter.convert( webDriverActionCondition.getParameterNames(), webDriverActionCondition.getParameterValues()); webDriverActionConfiguration.setParametersConfiguration(configurationMap); return webDriverActionConfiguration; } @Inject  ConditionASTNodeConverter(ParametersConfigurationConverter parametersConfigurationConverter); @Override WebDriverActionConfiguration convert(WebDriverActionCondition webDriverActionCondition);  }### Answer:
@Test public void convertElementByCssIsPresent() throws Exception { WebDriverActionCondition precondition = model.getActions().get(0).getPrecondition().getAction(); initMocks(precondition); ConditionASTNodeConverter conditionASTNodeConverter = new ConditionASTNodeConverter(parametersConfigurationConverter); WebDriverActionConfiguration actual = conditionASTNodeConverter.convert(precondition); assertEquals(ELEMENT_BY_CSS_TO_BE_PRESENT, actual.getWebDriverActionType()); assertEquals(parameterConfigurationMap, actual.getParametersConfiguration()); }
@Test public void convertTextOfElementWithCssSelectorToBe() throws Exception { WebDriverActionCondition precondition = model.getActions().get(2).getPrecondition().getAction(); initMocks(precondition); ConditionASTNodeConverter conditionASTNodeConverter = new ConditionASTNodeConverter(parametersConfigurationConverter); WebDriverActionConfiguration actual = conditionASTNodeConverter.convert(precondition); assertEquals(TEXT_OF_ELEMENT_FOUND_BY_CSS_SELECTOR_TO_BE, actual.getWebDriverActionType()); assertEquals(parameterConfigurationMap, actual.getParametersConfiguration()); }