Set<ResourceHandle> result = provisioner.provisionResources(Collections.singleton(req));
List<ResourceHandle> handles = new ArrayList<>(result);
try {
// Verify the wiring
Environment environment = provisioner.getEnvironment();
Map<Resource, Wiring> wirings = environment.getWirings();
ResourceIdentity residA = ResourceIdentity.create("org.apache.camel.core", "2.11.0");
Resource resA = environment.getResource(residA);
Assert.assertNotNull("Resource in environment", resA);
Wiring wiringA = wirings.get(resA);
Assert.assertNotNull("Wiring in environment", wiringA);
Assert.assertEquals("Two required wires", 2, wiringA.getRequiredResourceWires(null).size());
// Build a resource that has a class loading dependency
DefaultResourceBuilder builderD = new DefaultResourceBuilder();
ResourceIdentity residD = ResourceIdentity.create(RESOURCE_D, Version.emptyVersion);
Map<String, Object> attsD = builderD.addIdentityCapability(residD).getAttributes();
attsD.put(ContentNamespace.CAPABILITY_RUNTIME_NAME_ATTRIBUTE, RESOURCE_D + ".war");
builderD.addContentCapability(deployer.getDeployment(RESOURCE_D));
Resource resD = builderD.getResource();
// Deploy a resource through the {@link ResourceInstaller}
handles.add(provisioner.installResource(resD));
Assert.assertTrue("At least one resource", handles.size() > 0);
// Make a call to the HttpService endpoint that goes through a Camel route
String reqspec = "/service?test=Kermit";
String context = RuntimeType.getRuntimeType() == RuntimeType.KARAF ? "" : "/" + RESOURCE_D;
Assert.assertEquals("Hello Kermit", performCall(context, reqspec));
// Verify module available
Runtime runtime = RuntimeLocator.getRequiredRuntime();
Assert.assertNotNull("Module available", runtime.getModule(residA));
Assert.assertNotNull("Module available", runtime.getModule(residD));
// Verify the wiring
wirings = environment.getWirings();
resA = environment.getResource(residA);
Assert.assertNotNull("Resource in environment", resA);
wiringA = wirings.get(resA);
Assert.assertEquals("Two required wires", 2, wiringA.getRequiredResourceWires(null).size());
// Deployment did not go through the {@link Provisioner} service
// There is no wiring
resD = environment.getResource(residD);
Assert.assertNotNull("Resource in environment", resD);
Wiring wiringB = wirings.get(resD);
Assert.assertNull("Wiring not in environment", wiringB);
} finally {
for (ResourceHandle handle : handles) {