CitrusRemoteConfigurationProducer { public void configure(@Observes(precedence = CitrusExtensionConstants.REMOTE_CONFIG_PRECEDENCE) BeforeSuite event) { try { log.info("Producing Citrus remote configuration"); configurationInstance.set(CitrusConfiguration.from(getRemoteConfigurationProperties())); } catch (Exception e) { log.error(CitrusExtensionConstants.CITRUS_EXTENSION_ERROR, e); throw e; } }  void configure(@Observes(precedence = CitrusExtensionConstants.REMOTE_CONFIG_PRECEDENCE) BeforeSuite event);  }
@Test public void testConfigure() throws Exception { reset(instanceProducer); doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { CitrusConfiguration configuration = (CitrusConfiguration) invocation.getArguments()[0]; Assert.assertEquals(configuration.getCitrusVersion(), "latest"); Assert.assertTrue(configuration.isAutoPackage()); Assert.assertEquals(configuration.getSuiteName(), "remoteSuite"); Assert.assertEquals(configuration.getConfigurationClass(), CitrusSpringConfig.class); return null; } }).when(instanceProducer).set(any(CitrusConfiguration.class)); InjectionHelper.inject(configurationProducer, "configurationInstance", instanceProducer); configurationProducer.configure(new BeforeSuite()); }