Search in sources :

Example 1 with ClusterStatusResult

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);
}
Also used : ClusterStatusResult(com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult)

Example 2 with ClusterStatusResult

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"));
}
Also used : ApiRole(com.cloudera.api.swagger.model.ApiRole) ClusterStatusResult(com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult) ApiService(com.cloudera.api.swagger.model.ApiService) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 3 with ClusterStatusResult

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"));
}
Also used : ClusterStatusResult(com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult) ApiService(com.cloudera.api.swagger.model.ApiService) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Aggregations

ClusterStatusResult (com.sequenceiq.cloudbreak.cluster.status.ClusterStatusResult)3 ApiService (com.cloudera.api.swagger.model.ApiService)2 Test (org.junit.Test)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ApiRole (com.cloudera.api.swagger.model.ApiRole)1