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