MetricsRegistryProducer { @Produces @ApplicationScoped public HealthCheckRegistry createHealthCheckRegistry() { HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); healthChecks.forEach(check -> healthCheckRegistry.register(check.getName(), check)); return healthCheckRegistry; }  @Produces @ApplicationScoped HealthCheckRegistry createHealthCheckRegistry(); @Produces @ApplicationScoped MetricRegistry createMetricRegistry();  }
@Test public void createHealthCheckRegistry() { assertNotNull("Health check registry is NULL.", healthCheckRegistry); assertSame("Wrong health check size.", 1, healthCheckRegistry.getNames().size()); assertTrue("Named healthy check missing.", healthCheckRegistry.getNames().contains("healthy")); }