Stagemonitor { @Deprecated public static void reset() { reset(null); } private  Stagemonitor(); static synchronized void init(); static synchronized void shutDown(); @Deprecated static MetricRegistry getMetricRegistry(); static Metric2Registry getMetric2Registry(); static HealthCheckRegistry getHealthCheckRegistry(); static ConfigurationRegistry getConfiguration(); static T getPlugin(Class<T> plugin); @Deprecated static T getConfiguration(Class<T> plugin); static MeasurementSession getMeasurementSession(); static boolean isStarted(); static List<String> getPathsOfWidgetTabPlugins(); static List<String> getPathsOfWidgetMetricTabPlugins(); @Deprecated static void reset(); @Deprecated static void reset(MeasurementSession measurementSession);  }
@Test public void testDisabledPlugin() throws Exception { when(corePlugin.isStagemonitorActive()).thenReturn(true); when(corePlugin.getDisabledPlugins()).thenReturn(Collections.singletonList("TestExceptionPlugin")); Stagemonitor.reset(new MeasurementSession("StagemonitorTest", "testHost", "testInstance")); assertThat(healthCheckRegistry.runHealthCheck("TestPlugin").isHealthy()).isTrue(); assertThat(healthCheckRegistry.runHealthCheck("TestExceptionPlugin").isHealthy()).isFalse(); assertThat(healthCheckRegistry.runHealthCheck("TestExceptionPlugin").getMessage()).isEqualTo("disabled via configuration"); }