CitrusConfigurationProducer { public void configure(@Observes ArquillianDescriptor descriptor) { try { log.info("Producing Citrus configuration"); configurationInstance.set(CitrusConfiguration.from(descriptor)); } catch (Exception e) { log.error(CitrusExtensionConstants.CITRUS_EXTENSION_ERROR, e); throw e; } }  void configure(@Observes ArquillianDescriptor descriptor);  }
@Test public void testConfigure() throws Exception { reset(descriptor, extension, instanceProducer); when(descriptor.getExtensions()).thenReturn(Collections.singletonList(extension)); when(extension.getExtensionName()).thenReturn(CitrusExtensionConstants.CITRUS_EXTENSION_QUALIFIER); when(extension.getExtensionProperties()).thenReturn(Collections.<String, String>emptyMap()); doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { CitrusConfiguration configuration = (CitrusConfiguration) invocation.getArguments()[0]; Assert.assertNull(configuration.getCitrusVersion()); Assert.assertTrue(configuration.isAutoPackage()); return null; } }).when(instanceProducer).set(any(CitrusConfiguration.class)); InjectionHelper.inject(configurationProducer, "configurationInstance", instanceProducer); configurationProducer.configure(descriptor); }