@Test public void getHealth () { Mockito.doReturn(AdminState.STARTED).when(adminManager).getAdminState(); doReturn(Duration.ZERO).when(adminManager).getTimeInState(); Assert.assertEquals(SystemHealthState.OK, adminHealth.getHealth()); }
@Override public SystemHealthState getHealth () { boolean healthyState = AdminState.getHealthyStates().contains(adminManager.getAdminState()); boolean longTimeInState = adminManager.getTimeInState().getSeconds() > 60 * 5; return (!healthyState) && longTimeInState ? SystemHealthState.ERROR : SystemHealthState.OK; }
AdminHealth implements SystemHealth { @Override public SystemHealthState getHealth () { boolean healthyState = AdminState.getHealthyStates().contains(adminManager.getAdminState()); boolean longTimeInState = adminManager.getTimeInState().getSeconds() > 60 * 5; return (!healthyState) && longTimeInState ? SystemHealthState.ERROR : SystemHealthState.OK; } }
AdminHealth implements SystemHealth { @Override public SystemHealthState getHealth () { boolean healthyState = AdminState.getHealthyStates().contains(adminManager.getAdminState()); boolean longTimeInState = adminManager.getTimeInState().getSeconds() > 60 * 5; return (!healthyState) && longTimeInState ? SystemHealthState.ERROR : SystemHealthState.OK; } @Autowired  AdminHealth(); }
AdminHealth implements SystemHealth { @Override public SystemHealthState getHealth () { boolean healthyState = AdminState.getHealthyStates().contains(adminManager.getAdminState()); boolean longTimeInState = adminManager.getTimeInState().getSeconds() > 60 * 5; return (!healthyState) && longTimeInState ? SystemHealthState.ERROR : SystemHealthState.OK; } @Autowired  AdminHealth(); @Override SystemHealthState getHealth(); }
AdminHealth implements SystemHealth { @Override public SystemHealthState getHealth () { boolean healthyState = AdminState.getHealthyStates().contains(adminManager.getAdminState()); boolean longTimeInState = adminManager.getTimeInState().getSeconds() > 60 * 5; return (!healthyState) && longTimeInState ? SystemHealthState.ERROR : SystemHealthState.OK; } @Autowired  AdminHealth(); @Override SystemHealthState getHealth();  }