use of com.adaptris.core.services.aggregator.MessageAggregatorTest.EvenOddCondition in project interlok by adaptris.
the class AppendinglMessageAggregatorTest method testAggregate_WithFilter.
@Test
public void testAggregate_WithFilter() throws Exception {
AppendingMessageAggregator aggr = createAggregatorForTests();
aggr.setFilterCondition(new EvenOddCondition());
AdaptrisMessage original = AdaptrisMessageFactory.getDefaultInstance().newMessage("Goodbye");
AdaptrisMessage splitMsg1 = AdaptrisMessageFactory.getDefaultInstance().newMessage(" Cruel ");
AdaptrisMessage splitMsg2 = AdaptrisMessageFactory.getDefaultInstance().newMessage("World");
aggr.joinMessage(original, Arrays.asList(new AdaptrisMessage[] { splitMsg1, splitMsg2 }));
// First message was skipped, 2nd was merged.
assertEquals("GoodbyeWorld", original.getContent());
}
Aggregations