Section extends
		AbstractObligationLevelRedactionHandler { @Override public void execute(Document xmlDocument, XacmlResult xacmlResult, FactModel factModel, Document factModelDocument, RuleExecutionContainer ruleExecutionContainer, List<Node> listOfNodes, Set<String> redactSectionCodesAndGeneratedEntryIds, Set<String> redactSectionCodes, String sectionLoincCode) throws XPathExpressionException { Assert.notNull(sectionLoincCode, this.getClass().getSimpleName() + " requires the c32 section LOINC code to be provided."); int added = addNodesToList(xmlDocument, listOfNodes, redactSectionCodesAndGeneratedEntryIds, XPATH_SECTION, sectionLoincCode); if (added > 0) { redactSectionCodes.add(sectionLoincCode); } } Section(DocumentAccessor documentAccessor); @Override void execute(Document xmlDocument, XacmlResult xacmlResult,
			FactModel factModel, Document factModelDocument,
			RuleExecutionContainer ruleExecutionContainer,
			List<Node> listOfNodes,
			Set<String> redactSectionCodesAndGeneratedEntryIds,
			Set<String> redactSectionCodes, String sectionLoincCode); static final String XPATH_SECTION; }
@Test public void testExecute() throws IOException, SimpleMarshallerException, XPathExpressionException { String sectionCode = "11450-4"; String c32FileName = "MIE_SampleC32.xml"; String factmodelXml = fileReader.readFile(TEST_PATH + FACTMODEL_PATH + c32FileName); String c32 = embeddedClinicalDocumentExtractor.extractClinicalDocumentFromFactModel(factmodelXml); String ruleExecutionContainerXml = fileReader.readFile(TEST_PATH + RULEEXECUTIONCONTAINER_PATH + c32FileName); RuleExecutionContainer ruleExecutionContainer = marshaller.unmarshalFromXml(RuleExecutionContainer.class, ruleExecutionContainerXml); Document c32Document = documentXmlConverter.loadDocument(c32); Document factModelDocument = documentXmlConverter.loadDocument(factmodelXml); FactModel factModel = marshaller.unmarshalFromXml(FactModel.class, factmodelXml); List<Node> listOfNodes = new LinkedList<Node>(); Set<String> redactSectionCodesAndGeneratedEntryIds = new HashSet<String>(); Set<String> redactSectionCodes = new HashSet<String>(); factModel.getXacmlResult().getPdpObligations().add(sectionCode); sut.execute(c32Document, factModel.getXacmlResult(), factModel, factModelDocument, ruleExecutionContainer, listOfNodes, redactSectionCodesAndGeneratedEntryIds, redactSectionCodes, sectionCode); assertEquals(1, listOfNodes.size()); assertEquals(1, redactSectionCodesAndGeneratedEntryIds.size()); assertEquals(1, redactSectionCodes.size()); assertEquals("component", listOfNodes.get(0).getNodeName()); assertEquals("section", listOfNodes.get(0).getChildNodes().item(1).getNodeName()); assertEquals(sectionCode, redactSectionCodesAndGeneratedEntryIds.toArray()[0]); assertEquals(sectionCode, redactSectionCodes.toArray()[0]); }