PassthroughOutboundDocSubmissionDeferredRequest implements OutboundDocSubmissionDeferredRequest { protected DocSubmissionDeferredRequestAuditLogger getAuditLogger() { return new DocSubmissionDeferredRequestAuditLogger(); } PassthroughOutboundDocSubmissionDeferredRequest(); @Override XDRAcknowledgementType provideAndRegisterDocumentSetBAsyncRequest(
        ProvideAndRegisterDocumentSetRequestType body, AssertionType assertion,
        NhinTargetCommunitiesType targets, UrlInfoType urlInfo);  }
@Test public void testProvideAndRegisterDocumentSetB() { ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targetCommunities = new NhinTargetCommunitiesType(); when(mockDelegate.process(any(OutboundDocSubmissionDeferredRequestOrchestratable.class))).thenReturn( createOutboundDocSubmissionDeferredRequestOrchestratable()); XDRAcknowledgementType response = runProvideAndRegisterDocumentSetBRequest(request, assertion, targetCommunities, getAuditLogger(true)); assertNotNull(response); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, response.getMessage().getStatus()); assertNotNull("Assertion MessageId is null", assertion.getMessageId()); verify(mockEJBLogger).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME), any(DocSubmissionDeferredRequestAuditTransforms.class)); }
@Test public void testAuditLoggingOffForDSDeferredRequest() { ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targetCommunities = new NhinTargetCommunitiesType(); when(mockDelegate.process(any(OutboundDocSubmissionDeferredRequestOrchestratable.class))).thenReturn( createOutboundDocSubmissionDeferredRequestOrchestratable()); XDRAcknowledgementType response = runProvideAndRegisterDocumentSetBRequest(request, assertion, targetCommunities, getAuditLogger(false)); assertNotNull(response); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, response.getMessage().getStatus()); assertNotNull("Assertion MessageId is null", assertion.getMessageId()); verify(mockEJBLogger, never()).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME), any(DocSubmissionDeferredRequestAuditTransforms.class)); }