Source:
<code>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); <START> PatientDiscoveryDeferredRequestAuditLogger auditLogger = mock(PatientDiscoveryDeferredRequestAuditLogger.class); <END> 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)); }</code><technical_language>PatientDiscoveryDeferredRequestAuditLogger is in methods. final object class get loaded</technical_language>

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)); }