Hello all,
I have a camel spring boot application with routes in separate XML files
I want to write some unit tests but there is a problem to find these routes
from a test class, it is able to start routes only if I put them into the
camelContext element
I know I can specify which directories should be scan for xml routes using
"camel.springboot.xml-routes" property (at the moment I am at Camel 2.23) for
an application itself, and what about a test class? Is there a way to let it
know where the routes are?
Thanks in advance!
My test class is as simple as
@RunWith(CamelSpringBootRunner.class)
@SpringBootTest
@ContextConfiguration(locations = "classpath:beans.xml")
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class DemoApplicationTests {
@Autowired
private CamelContext camelContext;
@Autowired
private ProducerTemplate template;
@EndpointInject(uri="mock:test")
private MockEndpoint mocked;
@Test
public void simpleTest() throws Exception {
mocked.expectedMessageCount(1);
template.sendBody( "direct:start", "Hello");
mocked.assertIsSatisfied();
};
}
Best regards,
Grigorii