use of com.sequenceiq.cloudbreak.common.type.HealthCheck in project cloudbreak by hortonworks.
the class StackStatusCheckerJobTest method setupForCM.
private void setupForCM() {
setStackStatus(DetailedStackStatus.AVAILABLE);
when(clusterApi.clusterStatusService()).thenReturn(clusterStatusService);
when(clusterStatusService.isClusterManagerRunningQuickCheck()).thenReturn(true);
Set<HealthCheck> healthChecks = Sets.newHashSet(new HealthCheck(HealthCheckType.HOST, HealthCheckResult.HEALTHY, Optional.empty()), new HealthCheck(HealthCheckType.CERT, HealthCheckResult.UNHEALTHY, Optional.empty()));
ExtendedHostStatuses extendedHostStatuses = new ExtendedHostStatuses(Map.of(HostName.hostName("host1"), healthChecks));
when(clusterStatusService.getExtendedHostStatuses(any())).thenReturn(extendedHostStatuses);
when(instanceMetaDataService.findNotTerminatedAndNotZombieForStack(anyLong())).thenReturn(Set.of(instanceMetaData));
when(instanceMetaData.getInstanceStatus()).thenReturn(InstanceStatus.SERVICES_HEALTHY);
}
use of com.sequenceiq.cloudbreak.common.type.HealthCheck in project cloudbreak by hortonworks.
the class VmStatusCheckerConclusionStepTest method createExtendedHostStatuses.
private ExtendedHostStatuses createExtendedHostStatuses(boolean healthy) {
Map<HostName, Set<HealthCheck>> hostStatuses = new HashMap<>();
HealthCheckResult status = healthy ? HealthCheckResult.HEALTHY : HealthCheckResult.UNHEALTHY;
String reason = healthy ? null : "error";
Set<HealthCheck> healthChecks = Sets.newHashSet(new HealthCheck(HealthCheckType.HOST, status, Optional.ofNullable(reason)));
hostStatuses.put(HostName.hostName("host1"), healthChecks);
hostStatuses.put(HostName.hostName("host2"), healthChecks);
return new ExtendedHostStatuses(hostStatuses);
}
Aggregations