Search in sources :

Example 1 with HelloWorldService

use of org.wildfly.camel.test.spring.subA.HelloWorldService in project wildfly-camel by wildfly-extras.

the class SpringIntegrationProducerTest method testSendingOneWayMessage.

@Test
public void testSendingOneWayMessage() throws Exception {
    SpringCamelContext camelctx = (SpringCamelContext) contextRegistry.getCamelContext("camel");
    Assert.assertNotNull(camelctx);
    ProducerTemplate template = camelctx.createProducerTemplate();
    template.sendBody("direct:onewayMessage", "Greet");
    HelloWorldService service = SpringUtils.getMandatoryBean(camelctx, HelloWorldService.class, "helloService");
    Assert.assertEquals("We should call the service", service.getGreetName(), "Greet");
}
Also used : ProducerTemplate(org.apache.camel.ProducerTemplate) HelloWorldService(org.wildfly.camel.test.spring.subA.HelloWorldService) SpringCamelContext(org.apache.camel.spring.SpringCamelContext) Test(org.junit.Test)

Aggregations

ProducerTemplate (org.apache.camel.ProducerTemplate)1 SpringCamelContext (org.apache.camel.spring.SpringCamelContext)1 Test (org.junit.Test)1 HelloWorldService (org.wildfly.camel.test.spring.subA.HelloWorldService)1