PassthroughInboundDocRetrieve extends BaseInboundDocRetrieve { @Override public DocRetrieveAuditLogger getAuditLogger() { return auditLogger; } PassthroughInboundDocRetrieve();  PassthroughInboundDocRetrieve(PolicyTransformer pt, InboundDelegate ad,
        CONNECTInboundOrchestrator orch, DocRetrieveAuditLogger auditLogger); @Override InboundDocRetrieveOrchestratable createInboundOrchestrable(RetrieveDocumentSetRequestType body,
        AssertionType assertion, Properties webContextProperties); @Override CONNECTInboundOrchestrator getOrchestrator(); @Override DocRetrieveAuditLogger getAuditLogger();  }
@Test public void invoke() { RetrieveDocumentSetRequestType request = new RetrieveDocumentSetRequestType(); AssertionType assertion = new AssertionType(); RetrieveDocumentSetResponseType expectedResponse = new RetrieveDocumentSetResponseType(); Properties webContextProperties = new Properties(); InboundDocRetrievePolicyTransformer_g0 pt = new InboundDocRetrievePolicyTransformer_g0(); InboundDocRetrieveDelegate ad = new InboundDocRetrieveDelegate(); CONNECTInboundOrchestrator orch = mock(CONNECTInboundOrchestrator.class); InboundDocRetrieveOrchestratable orchestratable = mock(InboundDocRetrieveOrchestratable.class); when(orch.process(any(InboundDocRetrieveOrchestratable.class))).thenReturn(orchestratable); when(orchestratable.getResponse()).thenReturn(expectedResponse); PassthroughInboundDocRetrieve inboundDocRetrieve = new PassthroughInboundDocRetrieve(pt, ad, orch, getAuditLogger(true)); RetrieveDocumentSetResponseType actualResponse = inboundDocRetrieve.respondingGatewayCrossGatewayRetrieve( request, assertion, webContextProperties); assertSame(expectedResponse, actualResponse); verify(mockEJBLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_INBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq(NhincConstants.DOC_RETRIEVE_SERVICE_NAME), any(DocRetrieveAuditTransforms.class)); ArgumentCaptor<InboundDocRetrieveOrchestratable> orchArgument = ArgumentCaptor .forClass(InboundDocRetrieveOrchestratable.class); verify(orch).process(orchArgument.capture()); assertEquals(pt, orchArgument.getValue().getPolicyTransformer()); assertEquals(ad, orchArgument.getValue().getDelegate()); assertTrue(orchArgument.getValue().isPassthru()); }
@Test public void auditLoggingOffForInboundDR() { RetrieveDocumentSetRequestType request = new RetrieveDocumentSetRequestType(); AssertionType assertion = new AssertionType(); RetrieveDocumentSetResponseType expectedResponse = new RetrieveDocumentSetResponseType(); Properties webContextProperties = new Properties(); InboundDocRetrievePolicyTransformer_g0 pt = new InboundDocRetrievePolicyTransformer_g0(); InboundDocRetrieveDelegate ad = new InboundDocRetrieveDelegate(); CONNECTInboundOrchestrator orch = mock(CONNECTInboundOrchestrator.class); InboundDocRetrieveOrchestratable orchestratable = mock(InboundDocRetrieveOrchestratable.class); when(orch.process(any(InboundDocRetrieveOrchestratable.class))).thenReturn(orchestratable); when(orchestratable.getResponse()).thenReturn(expectedResponse); PassthroughInboundDocRetrieve inboundDocRetrieve = new PassthroughInboundDocRetrieve(pt, ad, orch, getAuditLogger(false)); RetrieveDocumentSetResponseType actualResponse = inboundDocRetrieve.respondingGatewayCrossGatewayRetrieve( request, assertion, webContextProperties); assertSame(expectedResponse, actualResponse); verify(mockEJBLogger, never()).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_INBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq(NhincConstants.DOC_RETRIEVE_SERVICE_NAME), any(DocRetrieveAuditTransforms.class)); ArgumentCaptor<InboundDocRetrieveOrchestratable> orchArgument = ArgumentCaptor .forClass(InboundDocRetrieveOrchestratable.class); verify(orch).process(orchArgument.capture()); assertEquals(pt, orchArgument.getValue().getPolicyTransformer()); assertEquals(ad, orchArgument.getValue().getDelegate()); assertTrue(orchArgument.getValue().isPassthru()); }