final ResourceConfig resourceConfig = new ResourceConfig();
final MonitoringFeature monitoringFeature = new MonitoringFeature();
monitoringFeature.setmBeansEnabled(true);
resourceConfig.register(monitoringFeature);
resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, false);
resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, false);
final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);
final ResourceConfig config = applicationHandler.getConfiguration();
Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
Assert.assertFalse(config.isRegistered(MonitoringEventListener.class));