@Test public void testPassiveMonitoringUpdateWARN() { final boolean[] result = new boolean[1]; AbstractHealthMonitorStrategy stategy = new AbstractHealthMonitorStrategy() { @Override public void update(boolean isHealthy) { result[0] = isHealthy; } }; ApplicationHealthMonitor sut = new ApplicationHealthMonitor(executionVenueNioServer, stategy, 0, monitorRegistry); sut.setServices(null); when(aggregator.getStatus()).thenReturn(Status.OK); Assert.assertEquals(true, result[0]); ArgumentCaptor<StatusChangeListener> captor = ArgumentCaptor.forClass(StatusChangeListener.class); verify(aggregator).addStatusChangeListener(captor.capture()); StatusChangeListener listener = captor.getValue(); listener.statusChanged(new StatusChangeEvent(statusSource, null, Status.WARN)); Assert.assertEquals(true, result[0]); }
@Override public void setServices(Set<Service> services) { if (monitorInterval > 0) { startActiveMonitoring(monitorRegistry.getStatusAggregator()); } else { startPassiveMonitoring(monitorRegistry.getStatusAggregator()); } }
ApplicationHealthMonitor implements ServiceAware { @Override public void setServices(Set<Service> services) { if (monitorInterval > 0) { startActiveMonitoring(monitorRegistry.getStatusAggregator()); } else { startPassiveMonitoring(monitorRegistry.getStatusAggregator()); } } }
ApplicationHealthMonitor implements ServiceAware { @Override public void setServices(Set<Service> services) { if (monitorInterval > 0) { startActiveMonitoring(monitorRegistry.getStatusAggregator()); } else { startPassiveMonitoring(monitorRegistry.getStatusAggregator()); } } ApplicationHealthMonitor(final ExecutionVenueNioServer nioServer,
                                    HealthMonitorStrategy strategy,
                                    long monitorInterval,
                                    MonitorRegistry monitorRegistry); }
ApplicationHealthMonitor implements ServiceAware { @Override public void setServices(Set<Service> services) { if (monitorInterval > 0) { startActiveMonitoring(monitorRegistry.getStatusAggregator()); } else { startPassiveMonitoring(monitorRegistry.getStatusAggregator()); } } ApplicationHealthMonitor(final ExecutionVenueNioServer nioServer,
                                    HealthMonitorStrategy strategy,
                                    long monitorInterval,
                                    MonitorRegistry monitorRegistry); @Override void setServices(Set<Service> services); }
ApplicationHealthMonitor implements ServiceAware { @Override public void setServices(Set<Service> services) { if (monitorInterval > 0) { startActiveMonitoring(monitorRegistry.getStatusAggregator()); } else { startPassiveMonitoring(monitorRegistry.getStatusAggregator()); } } ApplicationHealthMonitor(final ExecutionVenueNioServer nioServer,
                                    HealthMonitorStrategy strategy,
                                    long monitorInterval,
                                    MonitorRegistry monitorRegistry); @Override void setServices(Set<Service> services);  }