Source:
public void standardInboundPatientDiscoveryRequest() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); PatientDiscoveryPolicyChecker policyChecker = mock(PatientDiscoveryPolicyChecker.class); AdapterPatientDiscoveryDeferredReqErrorProxyObjectFactory proxyErrorFactory = mock(AdapterPatientDiscoveryDeferredReqErrorProxyObjectFactory.class); PatientDiscoveryDeferredRequestAuditLogger auditLogger = mock(PatientDiscoveryDeferredRequestAuditLogger.class); AdapterPatientDiscoveryDeferredReqProxyObjectFactory adapterFactory = mock(AdapterPatientDiscoveryDeferredReqProxyObjectFactory.class); AdapterPatientDiscoveryDeferredReqProxy adapterProxy = mock(AdapterPatientDiscoveryDeferredReqProxy.class); Properties webContextProperties = new Properties(); when(adapterFactory.getAdapterPatientDiscoveryDeferredReqProxy()).thenReturn(adapterProxy); when(adapterProxy.processPatientDiscoveryAsyncReq(request, assertion)).thenReturn(expectedResponse); when(policyChecker.checkIncomingPolicy(request, assertion)).thenReturn(true); StandardInboundPatientDiscoveryDeferredRequest standardPatientDiscovery = new StandardInboundPatientDiscoveryDeferredRequest(policyChecker, proxyErrorFactory, adapterFactory, auditLogger); MCCIIN000002UV01 actualResponse = standardPatientDiscovery .respondingGatewayPRPAIN201305UV02(request, assertion, webContextProperties); assertSame(expectedResponse, actualResponse); verify(auditLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull( NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq( NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq( NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME)); }

Target:
public void standardInboundPatientDiscoveryRequest() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); MCCIIN000002UV01 expectedResponse = new MCCIIN000002UV01(); PatientDiscoveryPolicyChecker policyChecker = mock(PatientDiscoveryPolicyChecker.class); AdapterPatientDiscoveryDeferredReqErrorProxyObjectFactory proxyErrorFactory = mock(AdapterPatientDiscoveryDeferredReqErrorProxyObjectFactory.class); AdapterPatientDiscoveryDeferredReqProxyObjectFactory adapterFactory = mock(AdapterPatientDiscoveryDeferredReqProxyObjectFactory.class); AdapterPatientDiscoveryDeferredReqProxy adapterProxy = mock(AdapterPatientDiscoveryDeferredReqProxy.class); Properties webContextProperties = new Properties(); when(adapterFactory.getAdapterPatientDiscoveryDeferredReqProxy()).thenReturn(adapterProxy); when(adapterProxy.processPatientDiscoveryAsyncReq(request, assertion)).thenReturn(expectedResponse); when(policyChecker.checkIncomingPolicy(request, assertion)).thenReturn(true); StandardInboundPatientDiscoveryDeferredRequest standardPatientDiscovery = new StandardInboundPatientDiscoveryDeferredRequest(policyChecker, proxyErrorFactory, adapterFactory, auditLogger); MCCIIN000002UV01 actualResponse = standardPatientDiscovery .respondingGatewayPRPAIN201305UV02(request, assertion, webContextProperties); assertSame(expectedResponse, actualResponse); verify(auditLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull( NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq( NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq( NhincConstants.PATIENT_DISCOVERY_DEFERRED_REQ_SERVICE_NAME)); }