StandardInboundDocSubmission extends AbstractInboundDocSubmission { public StandardInboundDocSubmission() { this(new AdapterDocSubmissionProxyObjectFactory(), new XDRPolicyChecker(), PropertyAccessor.getInstance(), new DocSubmissionAuditLogger()); } StandardInboundDocSubmission();  StandardInboundDocSubmission(AdapterDocSubmissionProxyObjectFactory adapterFactory,
        XDRPolicyChecker policyChecker,
        PropertyAccessor propertyAccessor, DocSubmissionAuditLogger auditLogger); @Override @InboundProcessingEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission", version = "") RegistryResponseType documentRepositoryProvideAndRegisterDocumentSetB(
        ProvideAndRegisterDocumentSetRequestType body, AssertionType assertion, Properties webContextProperties); @Override RegistryResponseType processDocSubmission(ProvideAndRegisterDocumentSetRequestType body, AssertionType assertion,
        Properties webContextProperties); DocSubmissionUtils getDocSubmissionUtils();  }
@Test public void standardInboundDocSubmission() 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); RegistryResponseType expectedResponse = new RegistryResponseType(); AdapterDocSubmissionProxy adapterProxy = mock(AdapterDocSubmissionProxy.class); Properties webContextProperties = new Properties(); when(adapterFactory.getAdapterDocSubmissionProxy()).thenReturn(adapterProxy); when(adapterProxy.provideAndRegisterDocumentSetB(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); StandardInboundDocSubmission standardDocSubmission = new StandardInboundDocSubmission(adapterFactory, policyChecker, propertyAccessor, getAuditLogger(true)) { @Override public DocSubmissionUtils getDocSubmissionUtils() { return mockDocSubmissionUtils; } }; RegistryResponseType actualResponse = standardDocSubmission.documentRepositoryProvideAndRegisterDocumentSetB( 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_SERVICE_NAME), any(DocSubmissionAuditTransforms.class)); }