Search in sources :

Example 1 with StackStatusV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response in project cloudbreak by hortonworks.

the class ClusterStatusSyncHandlerTest method testOnApplicationEventWhenCBStackStatusInActiveCBClusterStatusActive.

@Test
public void testOnApplicationEventWhenCBStackStatusInActiveCBClusterStatusActive() {
    Cluster cluster = getACluster(ClusterState.SUSPENDED);
    when(clusterService.findById(anyLong())).thenReturn(cluster);
    StackStatusV4Response stackStatusV4Response = new StackStatusV4Response();
    stackStatusV4Response.setStatus(Status.UPDATE_IN_PROGRESS);
    stackStatusV4Response.setClusterStatus(Status.AVAILABLE);
    when(cloudbreakCommunicator.getStackStatusByCrn(anyString())).thenReturn(stackStatusV4Response);
    underTest.onApplicationEvent(new ClusterStatusSyncEvent(AUTOSCALE_CLUSTER_ID));
    verify(clusterService, never()).setState(anyLong(), any(ClusterState.class));
    verify(cloudbreakCommunicator).getStackStatusByCrn(CLOUDBREAK_STACK_CRN);
}
Also used : ClusterState(com.sequenceiq.periscope.api.model.ClusterState) ClusterStatusSyncEvent(com.sequenceiq.periscope.monitor.event.ClusterStatusSyncEvent) Cluster(com.sequenceiq.periscope.domain.Cluster) StackStatusV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response) Test(org.junit.Test)

Example 2 with StackStatusV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response in project cloudbreak by hortonworks.

the class ClusterStatusSyncHandlerTest method getStackResponse.

private StackStatusV4Response getStackResponse(Status clusterStatus) {
    StackStatusV4Response stackResponse = new StackStatusV4Response();
    stackResponse.setStatus(clusterStatus);
    stackResponse.setClusterStatus(clusterStatus);
    return stackResponse;
}
Also used : StackStatusV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response)

Example 3 with StackStatusV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response in project cloudbreak by hortonworks.

the class StackToStatusConverterTest method testConvert.

@Test
public void testConvert() {
    // GIVEN
    // WHEN
    StackStatusV4Response result = underTest.convert(getSource());
    // THEN
    assertEquals(Long.valueOf(1L), result.getId());
    assertEquals(Status.AVAILABLE, result.getStatus());
    assertEquals(Status.AVAILABLE, result.getClusterStatus());
}
Also used : StackStatusV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response) AbstractEntityConverterTest(com.sequenceiq.cloudbreak.converter.AbstractEntityConverterTest) Test(org.junit.Test)

Example 4 with StackStatusV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response in project cloudbreak by hortonworks.

the class SdxClusterStatusCheckerJob method isUnreachable.

private boolean isUnreachable(StackStatusV4Response stack) {
    Status stackStatus = stack.getStatus();
    Status clusterStatus = stack.getClusterStatus();
    return stackStatus == Status.UNREACHABLE || (stackStatus == Status.AVAILABLE && clusterStatus == Status.UNREACHABLE);
}
Also used : Status(com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status)

Example 5 with StackStatusV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response in project cloudbreak by hortonworks.

the class CloudbreakPollerTest method statusResponse.

private StackStatusV4Response statusResponse(Status stackStatus, Status clusterStatus) {
    StackStatusV4Response statusV4Response = new StackStatusV4Response();
    statusV4Response.setStatus(stackStatus);
    statusV4Response.setClusterStatus(clusterStatus);
    return statusV4Response;
}
Also used : StackStatusV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response)

Aggregations

StackStatusV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackStatusV4Response)16 Cluster (com.sequenceiq.periscope.domain.Cluster)5 Test (org.junit.Test)4 Status (com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status)3 ClusterStatusSyncEvent (com.sequenceiq.periscope.monitor.event.ClusterStatusSyncEvent)3 SdxStatusEntity (com.sequenceiq.datalake.entity.SdxStatusEntity)2 ClusterState (com.sequenceiq.periscope.api.model.ClusterState)2 StackV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint)1 AutoscaleStackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.AutoscaleStackV4Response)1 CloudbreakClient (com.sequenceiq.cloudbreak.client.CloudbreakClient)1 AbstractEntityConverterTest (com.sequenceiq.cloudbreak.converter.AbstractEntityConverterTest)1 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)1 DatalakeStatusEnum (com.sequenceiq.datalake.entity.DatalakeStatusEnum)1 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)1 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1