camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Minh Tran <darth.minhs...@gmail.com>
Subject Re: testing routes when using spring boot
Date Tue, 21 Mar 2017 00:26:53 GMT
Hi

You can find it in the camel-test-spring.jar. So add that dependency in your pom.

The way to get the camel context would be just to inject it in just like any other spring
bean. For example:

@Autowired
private CamelContext context;

> On 21 Mar 2017, at 11:15 am, 129073.d.0002 <unto.j.valkonen@icloud.com> wrote:
> 
> I found this Camel Spring Boot test
> 
> "https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot".
> 
> It uses test setup:
> 
> @RunWith(CamelSpringBootRunner.class)
> @SpringBootTest(classes = SampleCamelApplication.class)
> public class SampleCamelApplicationTest {
> 
>    @Autowired
>    private CamelContext camelContext;
> 
> 
> I can't find a maven package (dependency) that includes
> CamelSpringBootRunner.class .
> 
> What would be best practise way to get CamelContex when using
> @RunWith(SpringRunner.class)?
> 
> Camel in Action 2ed does not help with testing in Spring Boot context :(
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/testing-routes-when-using-spring-boot-tp5795812.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message