This is how my tests are set up

@RunWith(CamelSpringBootRunner.class)
@MockEndpoints
@UseAdviceWith
@SpringBootTest(classes =
mydomain.springbootcamel.SpringBootCamelExamples.class)
public class RouteBTests {

  @Autowired
  private CamelContext camelContext;

  @Autowired
  private ProducerTemplate template;

  @Test
  public void whereIsBuckinghamPalaceTest() throws Exception {


I have all of my routes annotated to pick up rather than in a configuration
class.

package mydomain.springbootcamel;

import org.apache.camel.*;
import org.apache.camel.builder.*;

import org.springframework.stereotype.Component;

@Component
public class RouteB extends RouteBuilder{

  @Override
  public void configure() throws Exception {

    from("direct:RouteB")
            .routeId("RouteB")
            .log(LoggingLevel.INFO, "Received Body:
${body}").id("log-input")
            .setBody().simple("Who lives at ${body}")
            .log(LoggingLevel.INFO, "Converted Body:
${body}").id("log-result")
    ;
  }
}

Here is a repo to browse. 
https://github.com/owain68/camel-spring-boot-examples

HTH.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-Boot-startup-not-working-in-JUnit-tp5801391p5801397.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to