use of org.wildfly.extension.camel.WildFlyCamelContext in project wildfly-camel by wildfly-extras.
the class GuavaEventIntegrationTest method shouldForwardMessageToCamel.
@Test
public void shouldForwardMessageToCamel() throws Exception {
WildFlyCamelContext camelctx = new WildFlyCamelContext();
camelctx.getNamingContext().bind("eventBusA", eventBus);
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("guava-eventbus:eventBusA").to("mock:allEvents");
}
});
camelctx.start();
try {
String message = "message";
eventBus.post(message);
MockEndpoint mockAll = camelctx.getEndpoint("mock:allEvents", MockEndpoint.class);
mockAll.setExpectedMessageCount(1);
mockAll.assertIsSatisfied();
Assert.assertEquals(message, mockAll.getExchanges().get(0).getIn().getBody());
} finally {
camelctx.stop();
}
}
Aggregations