@Test public void testOnMessage_ServiceFailsFailureCallback() throws Exception { AtomicBoolean onSuccess = new AtomicBoolean(false); MockChannel channel = createChannel(new MockMessageProducer(), Arrays.asList(new Service[] {new ThrowExceptionService(new ConfiguredException("expected"))})); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(PAYLOAD_1); StandardWorkflow workflow = (StandardWorkflow) channel.getWorkflowList().get(0); try { start(channel); workflow.onAdaptrisMessage(msg, (m) -> { onSuccess.set(true); }, (m) -> { onSuccess.set(false); }); assertFalse(onSuccess.get()); } finally { stop(channel); } }
@Override public synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure) { super.onAdaptrisMessage(msg, success, failure); }
StandardWorkflow extends StandardWorkflowImpl { @Override public synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure) { super.onAdaptrisMessage(msg, success, failure); } }
StandardWorkflow extends StandardWorkflowImpl { @Override public synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure) { super.onAdaptrisMessage(msg, success, failure); } StandardWorkflow();  StandardWorkflow(AdaptrisMessageConsumer consumer, AdaptrisMessageProducer producer);  StandardWorkflow(AdaptrisMessageConsumer consumer, ServiceCollection services, AdaptrisMessageProducer producer); }
StandardWorkflow extends StandardWorkflowImpl { @Override public synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure) { super.onAdaptrisMessage(msg, success, failure); } StandardWorkflow();  StandardWorkflow(AdaptrisMessageConsumer consumer, AdaptrisMessageProducer producer);  StandardWorkflow(AdaptrisMessageConsumer consumer, ServiceCollection services, AdaptrisMessageProducer producer); @Override synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure); }
StandardWorkflow extends StandardWorkflowImpl { @Override public synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure) { super.onAdaptrisMessage(msg, success, failure); } StandardWorkflow();  StandardWorkflow(AdaptrisMessageConsumer consumer, AdaptrisMessageProducer producer);  StandardWorkflow(AdaptrisMessageConsumer consumer, ServiceCollection services, AdaptrisMessageProducer producer); @Override synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure);  }