Init { @PostConstruct protected void loadConfigurationOnStartup() { try { if (persistence.configurationExists(TenantFilter.DEFAULT_TENANTID)) { Configuration configuration = persistence.loadConfiguration(TenantFilter.DEFAULT_TENANTID); eventMapper.setConfiguration(configuration); complexEventProcessor.setConfiguration(configuration); subscriptionManager.setConfiguration(configuration); } } catch (PersistenceException | ConfigurationException e) { logger.error("Failed to load or apply persisted configuration", e); } }    }
@Test public void checkConfOk() throws ConfigurationException, PersistenceException { when(persistence.configurationExists(TenantFilter.DEFAULT_TENANTID)).thenReturn(true); when(persistence.loadConfiguration(TenantFilter.DEFAULT_TENANTID)).thenReturn(configuration); init.loadConfigurationOnStartup(); verify(complexEventProcessor).setConfiguration(eq(configuration)); verify(subscriptionManager).setConfiguration(eq(configuration)); verify(eventMapper).setConfiguration(configuration); }