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);
}
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;
}
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());
}
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);
}
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;
}
Aggregations