mardi 14 mars 2017

How to test an existing camel route?

I'm trying to test an existing Camel route, but it's proving much more difficult than I anticipated. Most of the documentation that I've seen online seems to create a new route in the test, and then test that. How can I test a route that I have already created?

For simplicity, I have created the simplest route that I can think of, but I can't for the life of me figure out how to use that route in a test.

Here's the route:

@Component
public class TestRouteBuilder extends RouteBuilder{

@Override
public void configure() throws Exception {
    from("direct:testStart")
            .log("Log triggered.")
            .to("direct:testEnd");
}
}

How can I use this route in a test?

I'm using Camel with Spring Boot, so my first thought was to inject the route into the test, but that didn't seem to work.

Any help appreciated, thanks.

Aucun commentaire:

Enregistrer un commentaire