@Test public void testExecute() throws IOException, SimpleMarshallerException, XPathExpressionException { List<Node> redactNodeList = new LinkedList<Node>(); String c32FileName = "JohnHalamkaCCDDocument_C32.xml"; String c32 = fileReader.readFile(TEST_PATH + c32FileName); Document c32Document = documentXmlConverter.loadDocument(c32); sut.execute(c32Document, redactSectionCodesAndGeneratedEntryIds,redactNodeList); assertEquals(redactNodeList.size(),12); }
@Override public void execute(Document xmlDocument, Set<String> redactSectionCodesAndGeneratedEntryIds, List<Node> listOfNodes) throws XPathExpressionException { final Set<String> sectionRedactionList = new HashSet<String>(); final NodeList sectionList = documentAccessor.getNodeList(xmlDocument, XPATH_ALL_SECTION_CODES); for (int i = 0; i < sectionList.getLength(); i++) { final Node node = sectionList.item(i); if (!sectionWhiteList.contains(node.getNodeValue())) { sectionRedactionList.add(node.getNodeValue()); } } for (final String header : sectionRedactionList) { addNodesToList(xmlDocument, listOfNodes, redactSectionCodesAndGeneratedEntryIds, XPATH_SECTION, header); } }
UnsupportedSectionHandler extends
		AbstractDocumentLevelRedactionHandler { @Override public void execute(Document xmlDocument, Set<String> redactSectionCodesAndGeneratedEntryIds, List<Node> listOfNodes) throws XPathExpressionException { final Set<String> sectionRedactionList = new HashSet<String>(); final NodeList sectionList = documentAccessor.getNodeList(xmlDocument, XPATH_ALL_SECTION_CODES); for (int i = 0; i < sectionList.getLength(); i++) { final Node node = sectionList.item(i); if (!sectionWhiteList.contains(node.getNodeValue())) { sectionRedactionList.add(node.getNodeValue()); } } for (final String header : sectionRedactionList) { addNodesToList(xmlDocument, listOfNodes, redactSectionCodesAndGeneratedEntryIds, XPATH_SECTION, header); } } }
UnsupportedSectionHandler extends
		AbstractDocumentLevelRedactionHandler { @Override public void execute(Document xmlDocument, Set<String> redactSectionCodesAndGeneratedEntryIds, List<Node> listOfNodes) throws XPathExpressionException { final Set<String> sectionRedactionList = new HashSet<String>(); final NodeList sectionList = documentAccessor.getNodeList(xmlDocument, XPATH_ALL_SECTION_CODES); for (int i = 0; i < sectionList.getLength(); i++) { final Node node = sectionList.item(i); if (!sectionWhiteList.contains(node.getNodeValue())) { sectionRedactionList.add(node.getNodeValue()); } } for (final String header : sectionRedactionList) { addNodesToList(xmlDocument, listOfNodes, redactSectionCodesAndGeneratedEntryIds, XPATH_SECTION, header); } } UnsupportedSectionHandler(DocumentAccessor documentAccessor,
			Set<String> sectionWhiteList); }
UnsupportedSectionHandler extends
		AbstractDocumentLevelRedactionHandler { @Override public void execute(Document xmlDocument, Set<String> redactSectionCodesAndGeneratedEntryIds, List<Node> listOfNodes) throws XPathExpressionException { final Set<String> sectionRedactionList = new HashSet<String>(); final NodeList sectionList = documentAccessor.getNodeList(xmlDocument, XPATH_ALL_SECTION_CODES); for (int i = 0; i < sectionList.getLength(); i++) { final Node node = sectionList.item(i); if (!sectionWhiteList.contains(node.getNodeValue())) { sectionRedactionList.add(node.getNodeValue()); } } for (final String header : sectionRedactionList) { addNodesToList(xmlDocument, listOfNodes, redactSectionCodesAndGeneratedEntryIds, XPATH_SECTION, header); } } UnsupportedSectionHandler(DocumentAccessor documentAccessor,
			Set<String> sectionWhiteList); @Override void execute(Document xmlDocument,
			Set<String> redactSectionCodesAndGeneratedEntryIds,
			List<Node> listOfNodes); }
UnsupportedSectionHandler extends
		AbstractDocumentLevelRedactionHandler { @Override public void execute(Document xmlDocument, Set<String> redactSectionCodesAndGeneratedEntryIds, List<Node> listOfNodes) throws XPathExpressionException { final Set<String> sectionRedactionList = new HashSet<String>(); final NodeList sectionList = documentAccessor.getNodeList(xmlDocument, XPATH_ALL_SECTION_CODES); for (int i = 0; i < sectionList.getLength(); i++) { final Node node = sectionList.item(i); if (!sectionWhiteList.contains(node.getNodeValue())) { sectionRedactionList.add(node.getNodeValue()); } } for (final String header : sectionRedactionList) { addNodesToList(xmlDocument, listOfNodes, redactSectionCodesAndGeneratedEntryIds, XPATH_SECTION, header); } } UnsupportedSectionHandler(DocumentAccessor documentAccessor,
			Set<String> sectionWhiteList); @Override void execute(Document xmlDocument,
			Set<String> redactSectionCodesAndGeneratedEntryIds,
			List<Node> listOfNodes);  }