GelfReporterProvider implements Provider<GelfReporter> { @Override public GelfReporter get() { return GelfReporter.forRegistry(metricRegistry) .prefixedWith(configuration.getPrefix()) .convertDurationsTo(configuration.getUnitDurations()) .convertRatesTo(configuration.getUnitRates()) .host(configuration.getHost()) .transport(configuration.getTransport()) .level(configuration.getLevel()) .source(configuration.getSource()) .tlsEnabled(configuration.isTlsEnabled()) .tlsCertVerificationEnabled(configuration.isTlsCertVerificationEnabled()) .tlsTrustCertChainFile(configuration.getTlsTrustCertChainFile()) .tcpKeepAlive(configuration.isTcpKeepAlive()) .tcpNoDelay(configuration.isTcpNoDelay()) .queueSize(configuration.getQueueSize()) .connectTimeout(Ints.saturatedCast(configuration.getConnectTimeout().toMilliseconds())) .reconnectDelay(Ints.saturatedCast(configuration.getReconnectDelay().toMilliseconds())) .sendBufferSize(configuration.getSendBufferSize()) .maxInFlightSends(configuration.getMaxInFlightSends()) .filter(new RegexMetricFilter(configuration.getIncludeMetrics())) .build(); } @Inject  GelfReporterProvider(MetricsGelfReporterConfiguration configuration, MetricRegistry metricRegistry); @Override GelfReporter get();  }
@Test public void get() throws Exception { final MetricsGelfReporterConfiguration configuration = new MetricsGelfReporterConfiguration(); final GelfReporterProvider provider = new GelfReporterProvider(configuration, new MetricRegistry()); final GelfReporter reporter = provider.get(); assertNotNull(reporter); }