PassthroughInboundPatientDiscoveryDeferredResponse extends
AbstractInboundPatientDiscoveryDeferredResponse { @Override public PatientDiscoveryDeferredResponseAuditLogger getAuditLogger() { return auditLogger; } PassthroughInboundPatientDiscoveryDeferredResponse();  PassthroughInboundPatientDiscoveryDeferredResponse(
        GenericFactory<AdapterPatientDiscoveryDeferredRespProxy> proxyFactory,
        PatientDiscoveryDeferredResponseAuditLogger auditLogger); @Override MCCIIN000002UV01 process(PRPAIN201306UV02 request, AssertionType assertion); @Override PatientDiscoveryDeferredResponseAuditLogger getAuditLogger();  }
@Test public void invoke() { PRPAIN201306UV02 request = new PRPAIN201306UV02(); AssertionType assertion = new AssertionType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); PatientDiscoveryDeferredResponseAuditLogger auditLogger = getAuditLogger(true); Properties webContextProperties = new Properties(); when(adapterFactory.create()).thenReturn(adapterProxy); when(adapterProxy.processPatientDiscoveryAsyncResp(request, assertion)).thenReturn(expectedResponse); PassthroughInboundPatientDiscoveryDeferredResponse passthroughPatientDiscovery = new PassthroughInboundPatientDiscoveryDeferredResponse(adapterFactory, auditLogger); MCCIIN000002UV01 actualResponse = passthroughPatientDiscovery.respondingGatewayDeferredPRPAIN201306UV02( 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.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME), any(PatientDiscoveryDeferredResponseAuditTransforms.class)); }
@Test public void auditOffForInboundPDDeferredResp() { PRPAIN201306UV02 request = new PRPAIN201306UV02(); AssertionType assertion = new AssertionType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); PatientDiscoveryDeferredResponseAuditLogger auditLogger = getAuditLogger(false); Properties webContextProperties = new Properties(); when(adapterFactory.create()).thenReturn(adapterProxy); when(adapterProxy.processPatientDiscoveryAsyncResp(request, assertion)).thenReturn(expectedResponse); PassthroughInboundPatientDiscoveryDeferredResponse passthroughPatientDiscovery = new PassthroughInboundPatientDiscoveryDeferredResponse(adapterFactory, auditLogger); MCCIIN000002UV01 actualResponse = passthroughPatientDiscovery.respondingGatewayDeferredPRPAIN201306UV02( 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.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME), any(PatientDiscoveryDeferredResponseAuditTransforms.class)); }