AppSetup extends BaseAppSetup { @PostConstruct void init() { try { configurationService.startBatch(); setupConfigurationGroup(ConfigType.GLOBAL, GLOBAL_SETTINGS, getGlobalConfiguration()); applicationStartedEvent.fire(new ApplicationStarted()); } catch (final Exception e) { logger.error("Error during update config", e); throw new RuntimeException(e); } finally { configurationService.endBatch(); } } protected  AppSetup(); @Inject  AppSetup(@Named("ioStrategy") final IOService ioService,
                    final RepositoryService repositoryService,
                    final OrganizationalUnitService organizationalUnitService,
                    final KieModuleService moduleService,
                    final ConfigurationService configurationService,
                    final ConfigurationFactory configurationFactory,
                    final Event<ApplicationStarted> applicationStartedEvent);   }
@Test public void init() { when(configurationFactory.newConfigGroup(ConfigType.GLOBAL, "settings", "")).thenReturn(new ConfigGroup()); ConfigItem configItem = new ConfigItem<>(); configItem.setName("name"); configItem.setName("value"); when(configurationFactory.newConfigItem(anyString(), anyString())).thenReturn(configItem); appSetup.init(); verify(applicationStartedEvent, times(1)).fire(any(ApplicationStarted.class)); }