@Test public void testOnMessageWithoutEvents() throws Exception { MockMessageProducer producer = new MockMessageProducer(); MockMessageProducer eventProd = new MockMessageProducer(); DefaultEventHandler evtHandler = new DefaultEventHandler(eventProd); MockChannel channel = createChannel(producer, Arrays.asList(new Service[] { new AddMetadataService(Arrays.asList(new MetadataElement[] { new MetadataElement(METADATA_KEY, METADATA_VALUE) })), new PayloadFromMetadataService(PAYLOAD_2) })); try { channel.setEventHandler(evtHandler); StandardWorkflow workflow = (StandardWorkflow) channel.getWorkflowList().get(0); workflow.setSendEvents(false); channel.prepare(); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(PAYLOAD_1); start(channel); workflow.onAdaptrisMessage(msg); assertEquals("Make sure all produced", 1, producer.getMessages().size()); for (Iterator i = producer.getMessages().iterator(); i.hasNext();) { AdaptrisMessage m = (AdaptrisMessage) i.next(); assertEquals(PAYLOAD_2, m.getContent()); assertTrue("Contains correct metadata key", m.containsKey(METADATA_KEY)); assertEquals(METADATA_VALUE, m.getMetadataValue(METADATA_KEY)); } waitForMessages(eventProd, 0); assertEquals(0, eventProd.messageCount()); } finally { stop(channel); stop(evtHandler); } }
@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);  }