I have some Camel blueprint unit tests running against a camel route. The route is a simple camel route that pulls messages from an activemq queue and then sends to another queue. I'm using an osgi service to expose the amq component I'm sending and receiving from.
<reference id="activemq-in" filter="(osgi.jndi.service.name=amq/in)" interface="org.apache.camel.Component" />
<camelContext>
<route>
<from uri="activemq-in:queue:some.queue" />
...
<to uri="activemq-in:queue:some.other.queue" />
</route>
</camelContext>
In my unit test, I'm stubbing out the amq component with something else however whenever I run my unit tests they always hang on waiting for the activemq dependencies for about 30 seconds before it gives up and the unit test runs successfully.
INFO BlueprintContainerImpl - Bundle UnitTest/1.0.0 is waiting for dependencies [(&(osgi.jndi.service.name=amq/in)(objectClass=org.apache.camel.Component))]
Is there any way I can have Camel blueprint testing skip the waiting for dependencies stage?
EDIT:
Sample blank unit test that will just load the blueprint, wait for 30 seconds for the osgi service that doesn't exist, then give up and pass:
public class CamelTest extends CamelBlueprintTestSupport {
// Loads the blueprint for the unit test
@Override
protected String getBlueprintDescriptor() {
return "OSGI-INF/blueprint/blueprint.xml";
}
// configures the osgi service to use the embedded amq broker instead of the osgi resource
@Override
protected BundleContext createBundleContext() throws Exception {
BundleContext bundleContext = super.createBundleContext();
ActiveMQComponent activeMQComponent = new ActiveMQComponent();
activeMQComponent.setBrokerURL("vm://amq");
Properties inboundProperties = new Properties();
inboundProperties.setProperty("osgi.jndi.service.name", "amq/in");
bundleContext.registerService("org.apache.camel.Component", activeMQComponent, (Dictionary) inboundProperties);
return bundleContext;
}
@Test
public void blankTest() {
}
}