MultiPayloadMessageAggregator extends MessageAggregatorImpl { @Override public void joinMessage(AdaptrisMessage original, Collection<AdaptrisMessage> messages) throws CoreException { aggregate(original, messages); }  @Override void joinMessage(AdaptrisMessage original, Collection<AdaptrisMessage> messages); @Override void aggregate(AdaptrisMessage original, Iterable<AdaptrisMessage> msgs);  }
@Test public void testAggregatorReplace() throws Exception { aggregator.setReplaceOriginalMessage(true); aggregator.joinMessage(message, messages); assertTrue(aggregator.getReplaceOriginalMessage()); assertEquals(2, message.getPayloadCount()); }
@Test public void testAggregatorAppend() throws Exception { aggregator.setReplaceOriginalMessage(false); aggregator.joinMessage(message, messages); assertFalse(aggregator.getReplaceOriginalMessage()); assertEquals(3, message.getPayloadCount()); }
@Test(expected = CoreException.class) public void testWrongMessageType() throws Exception { aggregator.joinMessage(AdaptrisMessageFactory.getDefaultInstance().newMessage(), messages); }