I want to create an integration test with CamelBlueprintTestSupport. I start my Camelcontext, which first looks fine:
[main] ingRestJobAdvertApiOfFirstbird INFO Skipping CamelContext as the system property skipStartingCamelContext is set to true. [main] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) launches
Routes also run. But then I just get this message in my console:
In the main loop, we have serious problems: java.lang.NullPointerException java.lang.NullPointerException on org.apache.felix.fileinstall.internal.DirectoryWatcher.run (DirectoryWatcher.java303)
Camel Version: 2.15.1.redhat-620133
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;
}
}