PassthroughOutboundDocQuery implements OutboundDocQuery { public PassthroughOutboundDocQuery() { super(); } PassthroughOutboundDocQuery();  PassthroughOutboundDocQuery(OutboundDocQueryDelegate delegate); @Override AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest request, AssertionType assertion,
        NhinTargetCommunitiesType targets);  }
@Test public void passthroughOutboundDocQuery() { OutboundDocQueryDelegate mockDelegate = mock(OutboundDocQueryDelegate.class); AdhocQueryResponse expectedResponse = new AdhocQueryResponse(); OutboundDocQueryOrchestratable orchestratableResponse = new OutboundDocQueryOrchestratable(); orchestratableResponse.setResponse(expectedResponse); final DocQueryAuditLogger auditLogger = getAuditLogger(true); when(mockDelegate.process(any(OutboundDocQueryOrchestratable.class))).thenReturn(orchestratableResponse); AdhocQueryRequest request = new AdhocQueryRequest(); AssertionType assertion = new AssertionType(); NhinTargetCommunitiesType targets = new NhinTargetCommunitiesType(); PassthroughOutboundDocQuery passthroughDocQuery = new PassthroughOutboundDocQuery(mockDelegate) { @Override protected DocQueryAuditLogger getAuditLogger() { return auditLogger; } }; AdhocQueryResponse actualResponse = passthroughDocQuery.respondingGatewayCrossGatewayQuery(request, assertion, targets); assertSame(expectedResponse, actualResponse); 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.DOC_QUERY_SERVICE_NAME), any(DocQueryAuditTransforms.class)); }