@Test public void testExecute_CleanUpSectionComponentsWithNoEntries_EmptySectionComponentsNull() throws IOException, SimpleMarshallerException, XPathExpressionException { DocumentAccessor documentAccessorMock = mock(DocumentAccessor.class); sut = new DocumentCleanupForNoEntryAndNoSection(documentAccessorMock); String c32FileName = "MIE_SampleC32-sectionWithNoEntries.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>(); when(documentAccessorMock.getNodeList(eq(c32Document), anyString())).thenReturn(null); sut.execute(c32Document, factModel.getXacmlResult(), factModel, factModelDocument, ruleExecutionContainer, listOfNodes, redactSectionCodesAndGeneratedEntryIds); assertEquals(2, documentAccessor.getNodeList(c32Document, " assertEquals(1, documentAccessor.getNodeList(c32Document, " assertEquals(1, documentAccessor.getNodeList(c32Document, " }
@Override public void execute(Document xmlDocument, XacmlResult xacmlResult, FactModel factModel, Document factModelDocument, RuleExecutionContainer ruleExecutionContainer, List<Node> listOfNodes, Set<String> redactSectionCodesAndGeneratedEntryIds) throws XPathExpressionException { cleanUpSectionComponentsWithNoEntries(xmlDocument); addEmptySectionComponentIfNoneExists(xmlDocument); }
DocumentCleanupForNoEntryAndNoSection extends
		AbstractPostRedactionLevelRedactionHandler { @Override public void execute(Document xmlDocument, XacmlResult xacmlResult, FactModel factModel, Document factModelDocument, RuleExecutionContainer ruleExecutionContainer, List<Node> listOfNodes, Set<String> redactSectionCodesAndGeneratedEntryIds) throws XPathExpressionException { cleanUpSectionComponentsWithNoEntries(xmlDocument); addEmptySectionComponentIfNoneExists(xmlDocument); } }
DocumentCleanupForNoEntryAndNoSection extends
		AbstractPostRedactionLevelRedactionHandler { @Override public void execute(Document xmlDocument, XacmlResult xacmlResult, FactModel factModel, Document factModelDocument, RuleExecutionContainer ruleExecutionContainer, List<Node> listOfNodes, Set<String> redactSectionCodesAndGeneratedEntryIds) throws XPathExpressionException { cleanUpSectionComponentsWithNoEntries(xmlDocument); addEmptySectionComponentIfNoneExists(xmlDocument); } DocumentCleanupForNoEntryAndNoSection(DocumentAccessor documentAccessor); }
DocumentCleanupForNoEntryAndNoSection extends
		AbstractPostRedactionLevelRedactionHandler { @Override public void execute(Document xmlDocument, XacmlResult xacmlResult, FactModel factModel, Document factModelDocument, RuleExecutionContainer ruleExecutionContainer, List<Node> listOfNodes, Set<String> redactSectionCodesAndGeneratedEntryIds) throws XPathExpressionException { cleanUpSectionComponentsWithNoEntries(xmlDocument); addEmptySectionComponentIfNoneExists(xmlDocument); } DocumentCleanupForNoEntryAndNoSection(DocumentAccessor documentAccessor); @Override void execute(Document xmlDocument, XacmlResult xacmlResult,
			FactModel factModel, Document factModelDocument,
			RuleExecutionContainer ruleExecutionContainer,
			List<Node> listOfNodes,
			Set<String> redactSectionCodesAndGeneratedEntryIds); }
DocumentCleanupForNoEntryAndNoSection extends
		AbstractPostRedactionLevelRedactionHandler { @Override public void execute(Document xmlDocument, XacmlResult xacmlResult, FactModel factModel, Document factModelDocument, RuleExecutionContainer ruleExecutionContainer, List<Node> listOfNodes, Set<String> redactSectionCodesAndGeneratedEntryIds) throws XPathExpressionException { cleanUpSectionComponentsWithNoEntries(xmlDocument); addEmptySectionComponentIfNoneExists(xmlDocument); } DocumentCleanupForNoEntryAndNoSection(DocumentAccessor documentAccessor); @Override void execute(Document xmlDocument, XacmlResult xacmlResult,
			FactModel factModel, Document factModelDocument,
			RuleExecutionContainer ruleExecutionContainer,
			List<Node> listOfNodes,
			Set<String> redactSectionCodesAndGeneratedEntryIds); static final String URN_HL7_V3; static final String TAG_COMPONENT; static final String TAG_SECTION; static final String XPATH_NO_COMPONENT_IN_STRUCTURED_BODY; static final String XPATH_SECTION_COMPONENT_WITH_NO_ENTRY; }