use of org.mule.tck.testmodels.fruit.Banana in project mule by mulesoft.
the class AbstractSplitterTestCase method allFilteredSplitter.
@Test
public void allFilteredSplitter() throws Exception {
TestSplitter splitter = new TestSplitter(true);
splitter.setListener(event -> {
throw new MessagingException(createStaticMessage("Expected"), event, splitter);
});
splitter.setMuleContext(muleContext);
Apple apple = new Apple();
Banana banana = new Banana();
Orange orange = new Orange();
FruitBowl fruitBowl = new FruitBowl();
fruitBowl.addFruit(apple);
fruitBowl.addFruit(banana);
fruitBowl.addFruit(orange);
final CoreEvent inEvent = eventBuilder(muleContext).message(of(fruitBowl)).build();
CoreEvent resultEvent = splitter.process(inEvent);
assertThat(resultEvent.getMessage().getPayload().getValue(), nullValue());
}
use of org.mule.tck.testmodels.fruit.Banana in project mule by mulesoft.
the class AbstractSplitterTestCase method failingNotFilteredSplitter.
@Test
public void failingNotFilteredSplitter() throws Exception {
TestSplitter splitter = new TestSplitter(false);
splitter.setListener(event -> {
throw new MessagingException(createStaticMessage("Expected"), event, splitter);
});
splitter.setMuleContext(muleContext);
Apple apple = new Apple();
Banana banana = new Banana();
Orange orange = new Orange();
FruitBowl fruitBowl = new FruitBowl();
fruitBowl.addFruit(apple);
fruitBowl.addFruit(banana);
fruitBowl.addFruit(orange);
final CoreEvent inEvent = eventBuilder(muleContext).message(of(fruitBowl)).build();
expected.expect(MessagingException.class);
expected.expectMessage("Expected");
splitter.process(inEvent);
}
Aggregations