@Test public void testESDisabledAndSpringCloudEnabled() throws IOException { when(corePlugin.getRemotePropertiesConfigUrls()).thenReturn(Collections.singletonList(new URL("http: initializer.onConfigurationInitialized(new StagemonitorConfigurationSourceInitializer.ConfigInitializedArguments(configuration)); verify(configuration).addConfigurationSourceAfter(any(RemotePropertiesConfigurationSource.class), eq(SimpleSource.class)); verify(configuration, never()).addConfigurationSourceAfter(any(ElasticsearchConfigurationSource.class), eq(SimpleSource.class)); }
@Override public void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments) throws IOException { final CorePlugin corePlugin = configInitializedArguments.getConfiguration().getConfig(CorePlugin.class); final Collection<String> elasticsearchConfigurationSourceIds = corePlugin.getElasticsearchConfigurationSourceProfiles(); if (!elasticsearchConfigurationSourceIds.isEmpty()) { addElasticsearchConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin, elasticsearchConfigurationSourceIds); } if (!corePlugin.getRemotePropertiesConfigUrls().isEmpty()) { logger.debug("RemotePropertiesConfigurationSource is enabled"); addRemotePropertiesConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin); } }
StagemonitorCoreConfigurationSourceInitializer extends StagemonitorConfigurationSourceInitializer { @Override public void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments) throws IOException { final CorePlugin corePlugin = configInitializedArguments.getConfiguration().getConfig(CorePlugin.class); final Collection<String> elasticsearchConfigurationSourceIds = corePlugin.getElasticsearchConfigurationSourceProfiles(); if (!elasticsearchConfigurationSourceIds.isEmpty()) { addElasticsearchConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin, elasticsearchConfigurationSourceIds); } if (!corePlugin.getRemotePropertiesConfigUrls().isEmpty()) { logger.debug("RemotePropertiesConfigurationSource is enabled"); addRemotePropertiesConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin); } } }
StagemonitorCoreConfigurationSourceInitializer extends StagemonitorConfigurationSourceInitializer { @Override public void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments) throws IOException { final CorePlugin corePlugin = configInitializedArguments.getConfiguration().getConfig(CorePlugin.class); final Collection<String> elasticsearchConfigurationSourceIds = corePlugin.getElasticsearchConfigurationSourceProfiles(); if (!elasticsearchConfigurationSourceIds.isEmpty()) { addElasticsearchConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin, elasticsearchConfigurationSourceIds); } if (!corePlugin.getRemotePropertiesConfigUrls().isEmpty()) { logger.debug("RemotePropertiesConfigurationSource is enabled"); addRemotePropertiesConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin); } }  }
StagemonitorCoreConfigurationSourceInitializer extends StagemonitorConfigurationSourceInitializer { @Override public void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments) throws IOException { final CorePlugin corePlugin = configInitializedArguments.getConfiguration().getConfig(CorePlugin.class); final Collection<String> elasticsearchConfigurationSourceIds = corePlugin.getElasticsearchConfigurationSourceProfiles(); if (!elasticsearchConfigurationSourceIds.isEmpty()) { addElasticsearchConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin, elasticsearchConfigurationSourceIds); } if (!corePlugin.getRemotePropertiesConfigUrls().isEmpty()) { logger.debug("RemotePropertiesConfigurationSource is enabled"); addRemotePropertiesConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin); } }  @Override void modifyConfigurationSources(ModifyArguments modifyArguments); @Override void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments); }
StagemonitorCoreConfigurationSourceInitializer extends StagemonitorConfigurationSourceInitializer { @Override public void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments) throws IOException { final CorePlugin corePlugin = configInitializedArguments.getConfiguration().getConfig(CorePlugin.class); final Collection<String> elasticsearchConfigurationSourceIds = corePlugin.getElasticsearchConfigurationSourceProfiles(); if (!elasticsearchConfigurationSourceIds.isEmpty()) { addElasticsearchConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin, elasticsearchConfigurationSourceIds); } if (!corePlugin.getRemotePropertiesConfigUrls().isEmpty()) { logger.debug("RemotePropertiesConfigurationSource is enabled"); addRemotePropertiesConfigurationSources(configInitializedArguments.getConfiguration(), corePlugin); } }  @Override void modifyConfigurationSources(ModifyArguments modifyArguments); @Override void onConfigurationInitialized(ConfigInitializedArguments configInitializedArguments);  }