use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.NODE_FAILURE in project cloudbreak by hortonworks.
the class UpdateNodeCountValidatorTest method validateClusterStatusDownscaleNodeFailureTargetedUpscaleNotSupported.
@Test
void validateClusterStatusDownscaleNodeFailureTargetedUpscaleNotSupported() {
when(targetedUpscaleSupportService.targetedUpscaleEntitlementsEnabled(any())).thenReturn(Boolean.FALSE);
Stack stack = new Stack();
stack.setName("stack");
Cluster cluster = mock(Cluster.class);
stack.setCluster(cluster);
stack.setStackStatus(new StackStatus(stack, DetailedStackStatus.NODE_FAILURE));
BadRequestException e = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateClusterStatus(stack, false));
assertEquals("Data Hub 'stack' is currently in 'NODE_FAILURE' state. Node count can only be updated if it's running.", e.getMessage());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.NODE_FAILURE in project cloudbreak by hortonworks.
the class UpdateNodeCountValidatorTest method validateClusterStatusDownscaleNodeFailureTargetedUpscaleSupported.
@Test
void validateClusterStatusDownscaleNodeFailureTargetedUpscaleSupported() {
when(targetedUpscaleSupportService.targetedUpscaleEntitlementsEnabled(any())).thenReturn(Boolean.TRUE);
Stack stack = new Stack();
stack.setName("stack");
Cluster cluster = mock(Cluster.class);
stack.setCluster(cluster);
stack.setStackStatus(new StackStatus(stack, DetailedStackStatus.NODE_FAILURE));
BadRequestException e = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateClusterStatus(stack, false));
assertEquals("Data Hub 'stack' is currently in 'NODE_FAILURE' state. Node count can only be updated if it's running.", e.getMessage());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.NODE_FAILURE in project cloudbreak by hortonworks.
the class ClusterCommonServiceTest method testRotateAutoTlsCertificatesWithNodeFailure.
@Test
public void testRotateAutoTlsCertificatesWithNodeFailure() {
NameOrCrn cluster = NameOrCrn.ofName("cluster");
Stack stack = new Stack();
stack.setName("cluster");
stack.setStackStatus(new StackStatus(stack, NODE_FAILURE));
when(stackService.getByNameOrCrnInWorkspace(cluster, 1L)).thenReturn(stack);
CertificatesRotationV4Request certificatesRotationV4Request = new CertificatesRotationV4Request();
BadRequestException badRequestException = assertThrows(BadRequestException.class, () -> underTest.rotateAutoTlsCertificates(cluster, 1L, certificatesRotationV4Request));
assertEquals("Stack 'cluster' is currently in 'NODE_FAILURE' state. Certificates rotation can only be made when the underlying stack is 'AVAILABLE'.", badRequestException.getMessage());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.NODE_FAILURE in project cloudbreak by hortonworks.
the class UpdateNodeCountValidatorTest method validateStackStatusDownscaleNodeFailureTargetedUpscaleSupported.
@Test
void validateStackStatusDownscaleNodeFailureTargetedUpscaleSupported() {
when(targetedUpscaleSupportService.targetedUpscaleEntitlementsEnabled(any())).thenReturn(Boolean.TRUE);
Stack stack = new Stack();
stack.setName("stack");
stack.setStackStatus(new StackStatus(stack, DetailedStackStatus.NODE_FAILURE));
BadRequestException e = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateStackStatus(stack, false));
assertEquals("Data Hub 'stack' is currently in 'NODE_FAILURE' state. Node count can only be updated if it's running.", e.getMessage());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.NODE_FAILURE in project cloudbreak by hortonworks.
the class UpdateNodeCountValidatorTest method validateClusterStatusUpscaleNodeFailureTargetedUpscaleNotSupported.
@Test
void validateClusterStatusUpscaleNodeFailureTargetedUpscaleNotSupported() {
when(targetedUpscaleSupportService.targetedUpscaleEntitlementsEnabled(any())).thenReturn(Boolean.FALSE);
Stack stack = new Stack();
stack.setName("stack");
Cluster cluster = mock(Cluster.class);
stack.setCluster(cluster);
stack.setStackStatus(new StackStatus(stack, DetailedStackStatus.NODE_FAILURE));
BadRequestException e = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateClusterStatus(stack, false));
assertEquals("Data Hub 'stack' is currently in 'NODE_FAILURE' state. Node count can only be updated if it's running.", e.getMessage());
}
Aggregations