I want to create an integration test with CamelBlueprintTestSupport. I start my Camelcontext which looks ok at first:
[ main] ingRestJobAdvertApiOfFirstbird INFO Skipping starting CamelContext as system property skipStartingCamelContext is set to be true. [ main] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) is starting
Routes are also starting. But then I just get this message within my console:
In main loop, we have serious trouble: java.lang.NullPointerException java.lang.NullPointerException at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:303)
Camel Version: 2.15.1.redhat-620133
The Unit Test:
public class WhenUsingRestJobAdvertApiOfdemo extends CamelBlueprintTestSupport {
@Override
protected String getBlueprintDescriptor() {
return "OSGI-INF/blueprint/blueprint.xml";
}
@Override
protected String[] loadConfigAdminConfigurationFile() {
return new String[]{"src/test/resources/jobwebsite.connector.properties", "jobwebsite.connector"};
}
@Test
public void testRoute() throws Exception {
context.addRoutes(new MockServiceEndpoints());
JobRequest jobRequest = readJoData();
template.sendBody("direct:createjobIndemo", jobRequest);
String expectedBody = "<matched/>";
template.sendBodyAndHeader(expectedBody, "foo", "bar");
}
public JobRequest readJoData() throws IOException {
ObjectMapper mapper = new ObjectMapper();
JobRequest jobRequest = mapper.readValue(new File("src/test/resources/demo-data/job-Advert/job-123.json"), JobRequest.class);
return jobRequest;
}
}