### Question:
FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider = new FloodlightModuleConfigurationProvider(configData); dumpConfigData(module.getClass(), configData); return provider; } protected  FloodlightModuleConfigurationProvider(Map<String, String> configData); static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext,
                                                           IFloodlightModule module); static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext,
                                                           Class<? extends IFloodlightModule> module);  }### Answer:
@Test public void shouldCreateConfigFromContextParameters() { FloodlightModuleContext context = new FloodlightModuleContext(); IFloodlightModule module = niceMock(IFloodlightModule.class); context.addConfigParam(module, "bootstrap-servers", TEST_BOOTSTRAP_SERVERS); FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(context, module); KafkaChannelConfig kafkaConfig = provider.getConfiguration(KafkaChannelConfig.class); assertEquals(TEST_BOOTSTRAP_SERVERS, kafkaConfig.getBootstrapServers()); }
@Test public void shouldCreateEnvConfigFromContextParameters() { FloodlightModuleContext context = new FloodlightModuleContext(); IFloodlightModule module = niceMock(IFloodlightModule.class); context.addConfigParam(module, "environment-naming-prefix", TEST_PREFIX); FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(context, module); EnvironmentFloodlightConfig environmentConfig = provider.getConfiguration(EnvironmentFloodlightConfig.class); assertEquals(TEST_PREFIX, environmentConfig.getNamingPrefix()); }
@Test public void shouldCreateConfigWithEnvPrefix() { FloodlightModuleContext context = new FloodlightModuleContext(); IFloodlightModule module = niceMock(IFloodlightModule.class); context.addConfigParam(module, "environment-naming-prefix", TEST_PREFIX); FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(context, module); KafkaChannelConfig kafkaConsumerConfig = provider.getConfiguration(KafkaChannelConfig.class); assertEquals(TEST_PREFIX + "_floodlight", kafkaConsumerConfig.getGroupId()); }