@Test public void modifyData_whenDataWithElementIdAreDefined_returnDataWithInput() throws ProcessingException, ParametersException { configureProperlyElementId(extractElementDataModifier, "element_id"); String expectedOutput = "<input id=\"input_id\" />"; String inputData = "<div id='element_id'><form>" + expectedOutput + "</form></div>"; extractElementDataModifier.modifyData(inputData); }
@Override public String modifyData(String data) throws ProcessingException { String result = StringUtils.EMPTY; Document parsedCode = Jsoup.parse(data); if (elementId != null) { result = modifyDataForElementParam(parsedCode); } if (elementClass != null) { result = modifyDataForClassParam(parsedCode); } return result; }
ExtractElementDataModifier extends AbstractDataModifierJob<String> { @Override public String modifyData(String data) throws ProcessingException { String result = StringUtils.EMPTY; Document parsedCode = Jsoup.parse(data); if (elementId != null) { result = modifyDataForElementParam(parsedCode); } if (elementClass != null) { result = modifyDataForClassParam(parsedCode); } return result; } }
ExtractElementDataModifier extends AbstractDataModifierJob<String> { @Override public String modifyData(String data) throws ProcessingException { String result = StringUtils.EMPTY; Document parsedCode = Jsoup.parse(data); if (elementId != null) { result = modifyDataForElementParam(parsedCode); } if (elementClass != null) { result = modifyDataForClassParam(parsedCode); } return result; }  }
ExtractElementDataModifier extends AbstractDataModifierJob<String> { @Override public String modifyData(String data) throws ProcessingException { String result = StringUtils.EMPTY; Document parsedCode = Jsoup.parse(data); if (elementId != null) { result = modifyDataForElementParam(parsedCode); } if (elementClass != null) { result = modifyDataForClassParam(parsedCode); } return result; }  @Override void setParameters(Map<String, String> params); @Override String modifyData(String data); @Override String getInfo(); }
ExtractElementDataModifier extends AbstractDataModifierJob<String> { @Override public String modifyData(String data) throws ProcessingException { String result = StringUtils.EMPTY; Document parsedCode = Jsoup.parse(data); if (elementId != null) { result = modifyDataForElementParam(parsedCode); } if (elementClass != null) { result = modifyDataForClassParam(parsedCode); } return result; }  @Override void setParameters(Map<String, String> params); @Override String modifyData(String data); @Override String getInfo(); static final String NAME; static final String PARAM_ELEMENT_ID; static final String PARAM_ELEMENT_CLASS; }