@Test
public void testNoAddressResolutionForInfluxDb() throws Exception {

    final InfluxDbReporter.Builder builderSpy = mock(InfluxDbReporter.Builder.class);
    new InfluxDbReporterFactory() {
        @Override
        protected InfluxDbReporter.Builder builder(MetricRegistry registry) {
            return builderSpy;
        }
    }.build(new MetricRegistry());
    final ArgumentCaptor<InfluxDbHttpSender> argument = ArgumentCaptor.forClass(InfluxDbHttpSender.class);
    verify(builderSpy).build(argument.capture());
    final InfluxDbHttpSender influxDb = argument.getValue();
    String url = new URL("http", "localhost", 8086, "/write").toString() + "?db=&precision=m";
    assertThat(getField(influxDb, InfluxDbHttpSender.class, "url")).isEqualTo(new URL(url));
    assertThat(getField(influxDb, InfluxDbHttpSender.class, "connectTimeout")).isEqualTo(1500);
    assertThat(getField(influxDb, InfluxDbHttpSender.class, "readTimeout")).isEqualTo(1500);
    assertThat(
        getField(
            influxDb,
            InfluxDbHttpSender.class,
            "authStringEncoded")).isEqualTo(Base64.encodeBase64String("".getBytes(UTF_8)));
}