@Test public void testRemoveElementWithXmlPath() throws IOException, URISyntaxException { String path = getClass().getResource("/xml/test.xml").toURI().getPath(); Map<String, String> result = remove.execute(path, XML_PATH, " assertEquals(ResponseNames.SUCCESS, result.get(RESULT_TEXT)); assertEquals(SUCCESS, result.get(RETURN_CODE)); assertEquals(REMOVE_SUCCESS, result.get(RETURN_RESULT)); assertEquals(SUCCESS, result.get(RETURN_CODE)); }
@Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { Map<String, String> result = new HashMap<>(); try { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .build(); result = new RemoveService().execute(inputs, customInputs); } catch (Exception e) { ResultUtils.populateFailureResult(result, Constants.ErrorMessages.PARSING_ERROR + e.getMessage()); } return result; }
Remove { @Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { Map<String, String> result = new HashMap<>(); try { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .build(); result = new RemoveService().execute(inputs, customInputs); } catch (Exception e) { ResultUtils.populateFailureResult(result, Constants.ErrorMessages.PARSING_ERROR + e.getMessage()); } return result; } }
Remove { @Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { Map<String, String> result = new HashMap<>(); try { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .build(); result = new RemoveService().execute(inputs, customInputs); } catch (Exception e) { ResultUtils.populateFailureResult(result, Constants.ErrorMessages.PARSING_ERROR + e.getMessage()); } return result; }  }
Remove { @Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { Map<String, String> result = new HashMap<>(); try { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .build(); result = new RemoveService().execute(inputs, customInputs); } catch (Exception e) { ResultUtils.populateFailureResult(result, Constants.ErrorMessages.PARSING_ERROR + e.getMessage()); } return result; }  @Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) Map<String, String> execute(
            @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument,
            @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource,
            @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery,
            @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName,
            @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing); }
Remove { @Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { Map<String, String> result = new HashMap<>(); try { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .build(); result = new RemoveService().execute(inputs, customInputs); } catch (Exception e) { ResultUtils.populateFailureResult(result, Constants.ErrorMessages.PARSING_ERROR + e.getMessage()); } return result; }  @Action(name = "Remove", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) Map<String, String> execute(
            @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument,
            @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource,
            @Param(value = Constants.Inputs.XPATH_ELEMENT_QUERY, required = true) String xPathQuery,
            @Param(Constants.Inputs.ATTRIBUTE_NAME) String attributeName,
            @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing);  }