camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From user3152723 <>
Subject CamelSpringJUnit4ClassRunner with Spring Boot
Date Sat, 30 Aug 2014 19:53:00 GMT
I’m been trying to use Camel with
. Spring Boot, 
. test Routes with “@RunWith(CamelSpringJUnit4ClassRunner.class)”
.with    @Produce(uri = "direct:in")
    private ProducerTemplate producerTemplate;
.and    @EndpointInject(uri = "mock:out")
    private MockEndpoint out;

I’m not an experienced Spring specialist (Spring Boot seems like endless
labyrinth to me, with all of its @ContextConfiguration annotations). 

I’ve tested CamelSpringJUnit4ClassRunner using 2.14-SNAPSHOT version of
Camel. Is it supposed to work, or is there something not completed in Spring
4 support?

I wondered if anybody has working example code to share. It would be of lots
of help – waiting for release of 2.14, because we have decided to use Spring
Boot in our project – and hopefully Camel embedded.

My  last effort:

//@ContextConfiguration(classes = Application.class)
@ContextConfiguration(classes = {Application.class, MyRouteBuilder.class},
loader = SpringApplicationContextLoader.class)
public class TestinGcamel_2 {

    ApplicationContext ctx;

    CamelContext camelContext;

    @Produce(uri = "direct:in")
    private ProducerTemplate producerTemplate;

    @EndpointInject(uri = "mock:out")
    private MockEndpoint mockOut;

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message