SlobrokMonitorManagerImpl implements SlobrokApi, MonitorManager { @Override public ServiceStatusInfo getStatus(ApplicationId applicationId, ClusterId clusterId, ServiceType serviceType, ConfigId configId) { if (wouldNotMonitor(applicationId)) { return new ServiceStatusInfo(ServiceStatus.NOT_CHECKED); } Optional<String> slobrokServiceName = findSlobrokServiceName(serviceType, configId); if (slobrokServiceName.isPresent()) { synchronized (monitor) { SlobrokMonitor slobrokMonitor = slobrokMonitors.get(applicationId); if (slobrokMonitor != null && slobrokMonitor.registeredInSlobrok(slobrokServiceName.get())) { return new ServiceStatusInfo(ServiceStatus.UP); } else { return new ServiceStatusInfo(ServiceStatus.DOWN); } } } else { return new ServiceStatusInfo(ServiceStatus.NOT_CHECKED); } } @Inject  SlobrokMonitorManagerImpl(DuperModelManager duperModel);   SlobrokMonitorManagerImpl(Supplier<SlobrokMonitor> slobrokMonitorFactory, DuperModelManager duperModel); @Override void applicationActivated(ApplicationInfo application); @Override void applicationRemoved(ApplicationId id); @Override void bootstrapComplete(); @Override List<Mirror.Entry> lookup(ApplicationId id, String pattern); @Override ServiceStatusInfo getStatus(ApplicationId applicationId,
                                       ClusterId clusterId,
                                       ServiceType serviceType,
                                       ConfigId configId);  }
@Test public void testGetStatus_ApplicationNotInSlobrok() { when(slobrokMonitor.registeredInSlobrok("config.id")).thenReturn(true); assertEquals(ServiceStatus.DOWN, getStatus("container")); }
@Test public void testGetStatus_NotChecked() { assertEquals(ServiceStatus.NOT_CHECKED, getStatus("slobrok")); verify(slobrokMonitor, times(0)).registeredInSlobrok(any()); }