public void givenMetricsProviderWithoutSupportForHealthCheckWhenRequestingHealthCheckExpectDefaultNullImplementation()
throws Exception
{
MetricsProvider underTest = new MetricsProviderAdapter();
MetricsHealthCheckFactory factory = underTest.createFactory( MetricsHealthCheckFactory.class );
MetricsHealthCheck test = factory.registerHealthCheck( getClass(), "test", new MetricsHealthCheck()
{
@Override
public Result check()
throws Exception
{
throw new RuntimeException( "Not healthy!!!" );
}
} );
test.check(); // Should not throw an exception, as it should have been replaced by a null implementation.
}