StandardInboundDocSubmissionDeferredRequest extends AbstractInboundDocSubmissionDeferredRequest { public StandardInboundDocSubmissionDeferredRequest() { this(new AdapterDocSubmissionDeferredRequestProxyObjectFactory(), new XDRPolicyChecker(), PropertyAccessor .getInstance(), new DocSubmissionDeferredRequestAuditLogger(), new AdapterDocSubmissionDeferredRequestErrorProxyObjectFactory()); } StandardInboundDocSubmissionDeferredRequest();  StandardInboundDocSubmissionDeferredRequest(
        AdapterDocSubmissionDeferredRequestProxyObjectFactory adapterFactory, XDRPolicyChecker policyChecker,
        PropertyAccessor propertyAccessor, DocSubmissionDeferredRequestAuditLogger auditLogger,
        AdapterDocSubmissionDeferredRequestErrorProxyObjectFactory errorAdapterFactory); @Override @InboundProcessingEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionArgTransformerBuilder.class, serviceType = "Document Submission Deferred Request", version = "") XDRAcknowledgementType provideAndRegisterDocumentSetBRequest(ProvideAndRegisterDocumentSetRequestType body,
        AssertionType assertion, Properties webContextProperties); @Override XDRAcknowledgementType processDocSubmissionRequest(ProvideAndRegisterDocumentSetRequestType body,
        AssertionType assertion); DocSubmissionUtils getDocSubmissionUtils();  }
@Test public void standardInboundDocSubmissionDeferredRequest() throws PropertyAccessException { String localHCID = "1.1"; String senderHCID = "2.2"; ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = new AssertionType(); assertion.setHomeCommunity(new HomeCommunityType()); assertion.getHomeCommunity().setHomeCommunityId(senderHCID); XDRAcknowledgementType expectedResponse = new XDRAcknowledgementType(); Properties webContextProperties = new Properties(); when(adapterFactory.getAdapterDocSubmissionDeferredRequestProxy()).thenReturn(adapterProxy); when(adapterProxy.provideAndRegisterDocumentSetBRequest(request, assertion)).thenReturn(expectedResponse); when(propertyAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.HOME_COMMUNITY_ID_PROPERTY)).thenReturn(localHCID); when(policyChecker.checkXDRRequestPolicy(request, assertion, senderHCID, localHCID, NhincConstants.POLICYENGINE_INBOUND_DIRECTION)).thenReturn(true); final DocSubmissionUtils mockDocSubmissionUtils = mock(DocSubmissionUtils.class); StandardInboundDocSubmissionDeferredRequest standardDocSubmission = new StandardInboundDocSubmissionDeferredRequest( adapterFactory, policyChecker, propertyAccessor, getAuditLogger(true), errorAdapterFactory) { @Override public DocSubmissionUtils getDocSubmissionUtils() { return mockDocSubmissionUtils; } }; XDRAcknowledgementType actualResponse = standardDocSubmission.provideAndRegisterDocumentSetBRequest(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.NHINC_XDR_REQUEST_SERVICE_NAME), any(DocSubmissionDeferredRequestAuditTransforms.class)); }