@Test public void testUseProcessedMessage() throws Exception { MockMessageProducer mock1 = new MockMessageProducer(); MockMessageProducer mock2 = new MockMessageProducer(); MockChannel channel = createChannel(Arrays.asList(new AdaptrisMessageProducer[] { mock1, mock2 }), Arrays.asList(new Service[] { new PayloadFromTemplateService().withTemplate(MODIFIED_PAYLOAD) })); try { MultiProducerWorkflow workflow = (MultiProducerWorkflow) channel.getWorkflowList().get(0); workflow.setUseProcessedMessage(true); channel.prepare(); channel.requestStart(); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(ORIGINAL_PAYLOAD); workflow.onAdaptrisMessage(msg); assertEquals(1, mock1.getMessages().size()); assertEquals(MODIFIED_PAYLOAD, mock1.getMessages().get(0).getContent()); assertEquals(1, mock2.getMessages().size()); assertEquals(MODIFIED_PAYLOAD, mock2.getMessages().get(0).getContent()); } finally { channel.requestClose(); } }
boolean useProcessedMessage() { return BooleanUtils.toBooleanDefaultIfNull(getUseProcessedMessage(), false); }
MultiProducerWorkflow extends StandardWorkflow { boolean useProcessedMessage() { return BooleanUtils.toBooleanDefaultIfNull(getUseProcessedMessage(), false); } }
MultiProducerWorkflow extends StandardWorkflow { boolean useProcessedMessage() { return BooleanUtils.toBooleanDefaultIfNull(getUseProcessedMessage(), false); } MultiProducerWorkflow(); }
MultiProducerWorkflow extends StandardWorkflow { boolean useProcessedMessage() { return BooleanUtils.toBooleanDefaultIfNull(getUseProcessedMessage(), false); } MultiProducerWorkflow(); @Override synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure); void addStandaloneProducer(StandaloneProducer producer); List<StandaloneProducer> getStandaloneProducers(); void setStandaloneProducers(List<StandaloneProducer> l); void setUseProcessedMessage(Boolean useProc); Boolean getUseProcessedMessage(); }
MultiProducerWorkflow extends StandardWorkflow { boolean useProcessedMessage() { return BooleanUtils.toBooleanDefaultIfNull(getUseProcessedMessage(), false); } MultiProducerWorkflow(); @Override synchronized void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure); void addStandaloneProducer(StandaloneProducer producer); List<StandaloneProducer> getStandaloneProducers(); void setStandaloneProducers(List<StandaloneProducer> l); void setUseProcessedMessage(Boolean useProc); Boolean getUseProcessedMessage();  }