use of org.apache.druid.guice.JsonConfigurator in project druid by druid-io.
the class RequestLoggerProviderTest method testNoLoggerAtAll.
@Test
public void testNoLoggerAtAll() {
final Properties properties = new Properties();
properties.setProperty("dummy", "unrelated");
final JsonConfigurator configurator = new JsonConfigurator(mapper, Validation.buildDefaultValidatorFactory().getValidator());
final RequestLoggerProvider provider = configurator.configurate(properties, "log", RequestLoggerProvider.class, NoopRequestLoggerProvider.class);
Assert.assertThat(provider, CoreMatchers.instanceOf(NoopRequestLoggerProvider.class));
}
use of org.apache.druid.guice.JsonConfigurator in project druid by druid-io.
the class LookupListeningAnnouncerConfigTest method testSimpleInjection.
@Test
public void testSimpleInjection() {
final String lookupTier = "some_tier";
final JsonConfigurator configurator = injector.getBinding(JsonConfigurator.class).getProvider().get();
properties.put(PROPERTY_BASE + ".lookupTier", lookupTier);
final JsonConfigProvider<LookupListeningAnnouncerConfig> configProvider = JsonConfigProvider.of(PROPERTY_BASE, LookupListeningAnnouncerConfig.class);
configProvider.inject(properties, configurator);
final LookupListeningAnnouncerConfig config = configProvider.get().get();
Assert.assertEquals(lookupTier, config.getLookupTier());
}
use of org.apache.druid.guice.JsonConfigurator in project druid by druid-io.
the class LookupListeningAnnouncerConfigTest method testFailsOnEmptyTier.
@Test(expected = NullPointerException.class)
public void testFailsOnEmptyTier() {
final JsonConfigurator configurator = injector.getBinding(JsonConfigurator.class).getProvider().get();
properties.put(PROPERTY_BASE + ".lookupTier", "");
final JsonConfigProvider<LookupListeningAnnouncerConfig> configProvider = JsonConfigProvider.of(PROPERTY_BASE, LookupListeningAnnouncerConfig.class);
configProvider.inject(properties, configurator);
final LookupListeningAnnouncerConfig config = configProvider.get().get();
config.getLookupTier();
}
use of org.apache.druid.guice.JsonConfigurator in project druid by druid-io.
the class LookupListeningAnnouncerConfigTest method testDefaultInjection.
@Test
public void testDefaultInjection() {
final JsonConfigurator configurator = injector.getBinding(JsonConfigurator.class).getProvider().get();
final JsonConfigProvider<LookupListeningAnnouncerConfig> configProvider = JsonConfigProvider.of(PROPERTY_BASE, LookupListeningAnnouncerConfig.class);
configProvider.inject(properties, configurator);
final LookupListeningAnnouncerConfig config = configProvider.get().get();
Assert.assertEquals(LookupListeningAnnouncerConfig.DEFAULT_TIER, config.getLookupTier());
}
Aggregations