MetricsRegistryProducer { @Produces @ApplicationScoped public MetricRegistry createMetricRegistry() { MetricRegistry metricRegistry = new MetricRegistry(); metricRegistry.registerAll(new ClassLoadingGaugeSet()); metricRegistry.registerAll(new GarbageCollectorMetricSet()); metricRegistry.registerAll(new MemoryUsageGaugeSet()); return metricRegistry; }  @Produces @ApplicationScoped HealthCheckRegistry createHealthCheckRegistry(); @Produces @ApplicationScoped MetricRegistry createMetricRegistry();  }
@Test public void createMetricRegistry() { assertNotNull("Metric registry is NULL.", metricRegistry); assertSame("Wrong health check size.", 53, metricRegistry.getNames().size()); }