use of com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult in project cloudbreak by hortonworks.
the class StackStatusIntegrationTest method setUpClusterStatus.
private void setUpClusterStatus(ClusterStatus clusterStatus) {
when(clusterStatusService.getStatus(anyBoolean())).thenReturn(new ClusterStatusResult(clusterStatus, ""));
when(clusterStatusService.isClusterManagerRunningQuickCheck()).thenReturn(true);
}
use of com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult in project cloudbreak by hortonworks.
the class ClouderaManagerClusterStatusServiceTest method reportsAmbiguousRoleStatus.
@Test
public void reportsAmbiguousRoleStatus() throws ApiException {
cmIsReachable();
servicesAre(new ApiService().name("service1").serviceState(ApiServiceState.STARTED), new ApiService().name("service2").serviceState(ApiServiceState.STARTED));
rolesAre("service1", new ApiRole().name("role 1.1").roleState(ApiRoleState.STARTED), new ApiRole().name("role 1.2").roleState(ApiRoleState.STOPPED));
rolesAre("service2", new ApiRole().name("role 2.1").roleState(ApiRoleState.STARTED), new ApiRole().name("role 2.2").roleState(ApiRoleState.STOPPED));
ClusterStatusResult statusResult = subject.getStatus(true);
assertEquals(ClusterStatus.AMBIGUOUS, statusResult.getClusterStatus());
String statusReason = statusResult.getStatusReason();
assertTrue(statusReason, statusReason.contains("STARTED: role 1.1, role 2.1"));
assertTrue(statusReason, statusReason.contains("INSTALLED: role 1.2, role 2.2"));
}
use of com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult in project cloudbreak by hortonworks.
the class ClouderaManagerClusterStatusServiceTest method reportsAmbiguousServiceStatus.
@Test
public void reportsAmbiguousServiceStatus() throws ApiException {
cmIsReachable();
servicesAre(new ApiService().name("service1").serviceState(ApiServiceState.STARTED), new ApiService().name("service2").serviceState(ApiServiceState.STOPPED));
ClusterStatusResult statusResult = subject.getStatus(true);
assertEquals(ClusterStatus.AMBIGUOUS, statusResult.getClusterStatus());
String statusReason = statusResult.getStatusReason();
assertTrue(statusReason, statusReason.contains("STARTED: service1"));
assertTrue(statusReason, statusReason.contains("INSTALLED: service2"));
}
Aggregations