InfluxDbReporterProvider implements Provider<InfluxDbReporter> { @Override public InfluxDbReporter get() { return InfluxDbReporter.forRegistry(metricRegistry) .withTags(configuration.getTags()) .groupGauges(configuration.isGroupGauges()) .skipIdleMetrics(configuration.isSkipIdleMetrics()) .convertDurationsTo(configuration.getUnitDurations()) .convertRatesTo(configuration.getUnitRates()) .filter(new RegexMetricFilter(configuration.getIncludeMetrics())) .build(influxDbSender); } @Inject  InfluxDbReporterProvider(MetricsInfluxDbReporterConfiguration configuration,
                                    InfluxDbSender influxDbSender,
                                    MetricRegistry metricRegistry); @Override InfluxDbReporter get();  }
@Test public void get() throws Exception { final MetricsInfluxDbReporterConfiguration configuration = new MetricsInfluxDbReporterConfiguration(); final InfluxDbSender influxDbSender = new InfluxDbHttpSender("http", "localhost", 1234, "database", null, TimeUnit.SECONDS, 5000, 5000, ""); final InfluxDbReporterProvider provider = new InfluxDbReporterProvider(configuration, influxDbSender, new MetricRegistry()); final InfluxDbReporter reporter = provider.get(); assertNotNull(reporter); }