Instance<SpringIntegrationConfiguration> mockConfigurationInstance = mock(Instance.class);
when(mockConfigurationInstance.get()).thenReturn(configuration);
TestReflectionHelper.setFieldValue(instance, "configuration", mockConfigurationInstance);
Archive archive = instance.createAuxiliaryArchive();
assertNotNull("Method returned null.", archive);
assertTrue("The returned archive has incorrect type.", archive instanceof JavaArchive);
for (Class c : REQUIRED_CLASSES) {
assertTrue("The required type is missing: " + c.getName(),
archive.contains(TestResourceHelper.getClassResourcePath(c)));
}
}