MeteredConfigurationProvider implements ConfigurationProvider { @Override public Properties allConfigurationAsProperties() { Timer.Context context = allConfigurationAsPropertiesTimer.time(); try { return delegate.allConfigurationAsProperties(); } finally { context.stop(); } } MeteredConfigurationProvider(MetricRegistry metricRegistry, String metricPrefix, SimpleConfigurationProvider delegate); @Override Properties allConfigurationAsProperties(); @Override T getProperty(String key, Class<T> type); @Override T getProperty(String key, GenericTypeInterface genericType); @Override T bind(String prefix, Class<T> type);  }
@Test void allConfigurationAsPropertiesCallsDelegate() { Properties properties = new Properties(); when(delegate.allConfigurationAsProperties()).thenReturn(properties); assertThat(provider.allConfigurationAsProperties()).isEqualTo(properties); }