PassthroughOutboundDocSubmissionDeferredResponse implements OutboundDocSubmissionDeferredResponse { protected DSDeferredResponseAuditLogger getAuditLogger() { return new DSDeferredResponseAuditLogger(); } PassthroughOutboundDocSubmissionDeferredResponse(); @Override XDRAcknowledgementType provideAndRegisterDocumentSetBAsyncResponse(RegistryResponseType body,
        AssertionType assertion, NhinTargetCommunitiesType targets);  }
@Test public void testProvideAndRegisterDocumentSetB() { RegistryResponseType request = new RegistryResponseType(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targetCommunities = new NhinTargetCommunitiesType(); when(mockDelegate.process(Mockito.any(OutboundDocSubmissionDeferredResponseOrchestratable.class))).thenReturn( createOutboundDocSubmissionDeferredResponseOrchestratable()); XDRAcknowledgementType response = runProvideAndRegisterDocumentSetBResponse(request, assertion, targetCommunities, getAuditLogger(true)); assertNotNull("Assertion MessageId is null", assertion.getMessageId()); verify(mockEJBLogger).auditRequestMessage(eq(request), eq(assertion), isNotNull(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.NHINC_XDR_RESPONSE_SERVICE_NAME), any(DSDeferredResponseAuditTransforms.class)); assertNotNull(response); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, response.getMessage().getStatus()); }
@Test public void testAuditLoggingOffForDSDeferredResponse() { RegistryResponseType request = new RegistryResponseType(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targetCommunities = new NhinTargetCommunitiesType(); when(mockDelegate.process(Mockito.any(OutboundDocSubmissionDeferredResponseOrchestratable.class))).thenReturn( createOutboundDocSubmissionDeferredResponseOrchestratable()); XDRAcknowledgementType response = runProvideAndRegisterDocumentSetBResponse(request, assertion, targetCommunities, getAuditLogger(false)); assertNotNull("Assertion MessageId is null", assertion.getMessageId()); verify(mockEJBLogger, never()).auditRequestMessage(eq(request), eq(assertion), isNotNull(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.NHINC_XDR_RESPONSE_SERVICE_NAME), any(DSDeferredResponseAuditTransforms.class)); assertNotNull(response); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, response.getMessage().getStatus()); }