PassthroughInboundPatientDiscoveryDeferredRequest extends AbstractInboundPatientDiscoveryDeferredRequest { @Override public PatientDiscoveryDeferredRequestAuditLogger getAuditLogger() { return auditLogger; } PassthroughInboundPatientDiscoveryDeferredRequest();  PassthroughInboundPatientDiscoveryDeferredRequest(
        AdapterPatientDiscoveryDeferredReqProxyObjectFactory adapterFactory,
        PatientDiscoveryDeferredRequestAuditLogger auditLogger); @Override MCCIIN000002UV01 process(PRPAIN201305UV02 request, AssertionType assertion); @Override PatientDiscoveryDeferredRequestAuditLogger getAuditLogger();  }
@Test public void passthroughInboundPatientDiscoveryRequest() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); AdapterPatientDiscoveryDeferredReqProxyObjectFactory adapterFactory = mock(AdapterPatientDiscoveryDeferredReqProxyObjectFactory.class); AdapterPatientDiscoveryDeferredReqProxy adapterProxy = mock(AdapterPatientDiscoveryDeferredReqProxy.class); PatientDiscoveryDeferredRequestAuditLogger auditLogger = getAuditLogger(true); Properties webContextProperties = new Properties(); when(adapterFactory.getAdapterPatientDiscoveryDeferredReqProxy()).thenReturn(adapterProxy); when(adapterProxy.processPatientDiscoveryAsyncReq(request, assertion)).thenReturn(expectedResponse); PassthroughInboundPatientDiscoveryDeferredRequest passthroughPatientDiscovery = new PassthroughInboundPatientDiscoveryDeferredRequest(adapterFactory, auditLogger); MCCIIN000002UV01 actualResponse = passthroughPatientDiscovery.respondingGatewayPRPAIN201305UV02(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_REQ_SERVICE_NAME), any( PatientDiscoveryDeferredRequestAuditTransforms.class)); }
@Test public void auditOffForInboundPDDeferredReq() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); AdapterPatientDiscoveryDeferredReqProxyObjectFactory adapterFactory = mock(AdapterPatientDiscoveryDeferredReqProxyObjectFactory.class); AdapterPatientDiscoveryDeferredReqProxy adapterProxy = mock(AdapterPatientDiscoveryDeferredReqProxy.class); PatientDiscoveryDeferredRequestAuditLogger auditLogger = getAuditLogger(false); Properties webContextProperties = new Properties(); when(adapterFactory.getAdapterPatientDiscoveryDeferredReqProxy()).thenReturn(adapterProxy); when(adapterProxy.processPatientDiscoveryAsyncReq(request, assertion)).thenReturn(expectedResponse); PassthroughInboundPatientDiscoveryDeferredRequest passthroughPatientDiscovery = new PassthroughInboundPatientDiscoveryDeferredRequest(adapterFactory, auditLogger); MCCIIN000002UV01 actualResponse = passthroughPatientDiscovery.respondingGatewayPRPAIN201305UV02(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_REQ_SERVICE_NAME), any( PatientDiscoveryDeferredRequestAuditTransforms.class)); }