use of com.cloudera.api.swagger.model.ApiHealthCheck in project cloudbreak by hortonworks.
the class ClouderaManagerClusterStatusServiceTest method testEverythingGood.
@Test
public void testEverythingGood() throws ApiException {
hostsAre(new ApiHost().hostname("host1").addHealthChecksItem(new ApiHealthCheck().name(HOST_SCM_HEALTH).summary(ApiHealthSummary.GOOD)).addHealthChecksItem(new ApiHealthCheck().name(HOST_AGENT_CERTIFICATE_EXPIRY).summary(ApiHealthSummary.GOOD)), new ApiHost().hostname("host2").addHealthChecksItem(new ApiHealthCheck().name(HOST_SCM_HEALTH).summary(ApiHealthSummary.GOOD)).addHealthChecksItem(new ApiHealthCheck().name(HOST_AGENT_CERTIFICATE_EXPIRY).summary(ApiHealthSummary.GOOD).explanation("in 30 days")));
ExtendedHostStatuses extendedHostStatuses = subject.getExtendedHostStatuses(Optional.of("7.2.12"));
assertFalse(extendedHostStatuses.isAnyCertExpiring());
assertTrue(extendedHostStatuses.isHostHealthy(hostName("host1")));
assertTrue(extendedHostStatuses.isHostHealthy(hostName("host2")));
}
use of com.cloudera.api.swagger.model.ApiHealthCheck in project cloudbreak by hortonworks.
the class ClouderaManagerClusterStatusServiceTest method hostWithoutAppropriateHealthCheckIsIgnored.
@Test
public void hostWithoutAppropriateHealthCheckIsIgnored() throws ApiException {
hostsAre(new ApiHost().hostname("hostY").addHealthChecksItem(new ApiHealthCheck().name("fake_check").summary(ApiHealthSummary.BAD)));
assertFalse(subject.getExtendedHostStatuses(Optional.of("7.2.12")).getHostsHealth().containsKey(hostName("hostY")));
}
use of com.cloudera.api.swagger.model.ApiHealthCheck in project cloudbreak by hortonworks.
the class ClouderaManagerClusterStatusServiceTest method testCertExpiringEverythingElseGood.
@Test
public void testCertExpiringEverythingElseGood() throws ApiException {
hostsAre(new ApiHost().hostname("host1").addHealthChecksItem(new ApiHealthCheck().name(HOST_SCM_HEALTH).summary(ApiHealthSummary.GOOD)).addHealthChecksItem(new ApiHealthCheck().name(HOST_AGENT_CERTIFICATE_EXPIRY).summary(ApiHealthSummary.GOOD)), new ApiHost().hostname("host2").addHealthChecksItem(new ApiHealthCheck().name(HOST_SCM_HEALTH).summary(ApiHealthSummary.GOOD)).addHealthChecksItem(new ApiHealthCheck().name(HOST_AGENT_CERTIFICATE_EXPIRY).summary(ApiHealthSummary.CONCERNING).explanation("in 30 days")));
ExtendedHostStatuses extendedHostStatuses = subject.getExtendedHostStatuses(Optional.of("7.2.12"));
assertTrue(extendedHostStatuses.isHostHealthy(hostName("host1")));
assertTrue(extendedHostStatuses.isHostHealthy(hostName("host2")));
assertTrue(extendedHostStatuses.isAnyCertExpiring());
}
Aggregations