when(container1.getContainerName()).thenReturn(CONTAINER_1_NAME);
when(container2.getContainerName()).thenReturn(CONTAINER_2_NAME);
scenario.addDeployment(
new DeploymentDescription(DEPLOYMENT_1_NAME, ShrinkWrap.create(JavaArchive.class))
.setTarget(new TargetDescription(CONTAINER_1_NAME))
.shouldBeTestable(false)
.setOrder(2));
// should use testable archive
scenario.addDeployment(
new DeploymentDescription(DEPLOYMENT_2_NAME, ShrinkWrap.create(JavaArchive.class))
.setTarget(new TargetDescription(CONTAINER_2_NAME))
.setOrder(1)
.shouldBeTestable(true)
.setTestableArchive(ShrinkWrap.create(JavaArchive.class)));
// should not be deployed during Managed deployments
scenario.addDeployment(
new DeploymentDescription(DEPLOYMENT_3_NAME, ShrinkWrap.create(JavaArchive.class))
.setTarget(new TargetDescription(CONTAINER_2_NAME))
.setOrder(3)
.shouldBeTestable(false)
.shouldBeManaged(false));
scenario.addDeployment(
new DeploymentDescription(DEPLOYMENT_4_NAME, Descriptors.create(BeansDescriptor.class))
.setTarget(new TargetDescription(CONTAINER_1_NAME))
.setOrder(4)
.shouldBeManaged(true));
registry = new LocalContainerRegistry(injector.get());