OutboundDocSubmissionDeferredRequestDelegate implements OutboundDelegate { @Override public Orchestratable process(Orchestratable message) { if (message instanceof OutboundOrchestratable) { return process((OutboundOrchestratable) message); } return null; }  @Override Orchestratable process(Orchestratable message); @Override OutboundOrchestratable process(OutboundOrchestratable message); @Override void createErrorResponse(OutboundOrchestratable message, String error);  }
@Test public void testOrchestration_G1Context() { setMockContextFactoryToReturnG1(); OutboundDocSubmissionDeferredRequestDelegate delegate = createOutboundDocSubmissionDeferredRequestDelegate(); OutboundDocSubmissionDeferredRequestOrchestratable dsOrchestratable = createOutboundDocSubmissionDeferredRequestOrchestratable(delegate); XDRAcknowledgementType response = ((OutboundDocSubmissionDeferredRequestOrchestratable) delegate .process(dsOrchestratable)).getResponse(); context.assertIsSatisfied(); assertNotNull(response); assertEquals(RESPONSE_ID_G1, response.getMessage().getStatus()); }
@Test public void testOrchestration_UnknownContext() { setMockContextFactoryToReturnNull(); OutboundDocSubmissionDeferredRequestDelegate delegate = createOutboundDocSubmissionDeferredRequestDelegate(); OutboundDocSubmissionDeferredRequestOrchestratable dsOrchestratable = createOutboundDocSubmissionDeferredRequestOrchestratable(delegate); Orchestratable response = delegate .process(dsOrchestratable); context.assertIsSatisfied(); assertNull(response); }
@Test public void testOrchestration_GenericOrchestratable() { setMockContextFactoryToReturnG0(); OutboundDocSubmissionDeferredRequestDelegate delegate = createOutboundDocSubmissionDeferredRequestDelegate(); Orchestratable orchestratable = createOutboundDocSubmissionDeferredRequestOrchestratable(delegate); XDRAcknowledgementType response = ((OutboundDocSubmissionDeferredRequestOrchestratable) delegate .process(orchestratable)).getResponse(); context.assertIsSatisfied(); assertNotNull(response); assertEquals(RESPONSE_ID_G0, response.getMessage().getStatus()); }
@Test public void testOrchestration_NullOrchestratable() { OutboundDocSubmissionDeferredRequestDelegate delegate = createOutboundDocSubmissionDeferredRequestDelegate(); Orchestratable response = delegate.process(null); context.assertIsSatisfied(); assertNull(response); }
@Test public void testOrchestration_G0Context() { setMockContextFactoryToReturnG0(); OutboundDocSubmissionDeferredRequestDelegate delegate = createOutboundDocSubmissionDeferredRequestDelegate(); OutboundDocSubmissionDeferredRequestOrchestratable dsOrchestratable = createOutboundDocSubmissionDeferredRequestOrchestratable(delegate); XDRAcknowledgementType response = ((OutboundDocSubmissionDeferredRequestOrchestratable) delegate .process(dsOrchestratable)).getResponse(); context.assertIsSatisfied(); assertNotNull(response); assertEquals(RESPONSE_ID_G0, response.getMessage().getStatus()); }