From ca60b6aa1c6fde9144d63d88e7a8b8c743c79808 Mon Sep 17 00:00:00 2001 From: Prithvi Raj Date: Thu, 29 Sep 2016 14:29:20 -0400 Subject: [PATCH] Fix bug in dropwizard configuration --- .../com/uber/jaeger/dropwizard/Configuration.java | 2 +- .../com/uber/jaeger/dropwizard/ConfigurationTest.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 jaeger-dropwizard/src/test/java/com/uber/jaeger/dropwizard/ConfigurationTest.java diff --git a/jaeger-dropwizard/src/main/java/com/uber/jaeger/dropwizard/Configuration.java b/jaeger-dropwizard/src/main/java/com/uber/jaeger/dropwizard/Configuration.java index 46a07cab5..d72acc382 100644 --- a/jaeger-dropwizard/src/main/java/com/uber/jaeger/dropwizard/Configuration.java +++ b/jaeger-dropwizard/src/main/java/com/uber/jaeger/dropwizard/Configuration.java @@ -41,7 +41,7 @@ public Configuration( @JsonProperty("sampler") SamplerConfiguration samplerConfig, @JsonProperty("reporter") ReporterConfiguration reporterConfig) { super(serviceName, samplerConfig, reporterConfig); - this.disable = disable; + this.disable = disable == null ? false : disable; } @Override diff --git a/jaeger-dropwizard/src/test/java/com/uber/jaeger/dropwizard/ConfigurationTest.java b/jaeger-dropwizard/src/test/java/com/uber/jaeger/dropwizard/ConfigurationTest.java new file mode 100644 index 000000000..68df76720 --- /dev/null +++ b/jaeger-dropwizard/src/test/java/com/uber/jaeger/dropwizard/ConfigurationTest.java @@ -0,0 +1,11 @@ +package com.uber.jaeger.dropwizard; + +import org.junit.Test; + +public class ConfigurationTest { + + @Test + public void testInstantiableWithNulls() throws Exception { + new Configuration("serviceName", null, null, null); + } +}