Blueprint Testing
Available as of Camel 2.10
Testing is a crucial part of any development or integration work. Camel supports the definition of Blueprint routes, but given Blueprint is an OSGi specific technology, writing unit tests is quite difficult. This library leverages PojoSR which provides a service registry without using a fully compliant OSGi container. This allows defining real unit tests (as opposed to integration tests using Pax Exam.
Also notice the use of getBlueprintDescriptor
to specify the location of the OSGi Blueprint XML file.
If you have multiple OSGi Blueprint XML files, then you can specify them with a comma-separated list in the getBlueprintDescriptor
method.
Here's the Blueprint XML file:
In order to define blueprint tests, add the following dependency in your pom:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-test-blueprint</artifactId> <version>2.10</version> <scope>test</scope> </dependency>