use of com.sequenceiq.cloudbreak.domain.view.StackStatusView in project cloudbreak by hortonworks.
the class StackRuntimeVersionValidatorTest method createDatalakeStack.
private StackView createDatalakeStack(Status status) throws IllegalAccessException {
StackView stack = new StackView();
stack.setType(StackType.DATALAKE);
ClusterView cluster = new ClusterView();
cluster.setId(1L);
FieldUtils.writeField(stack, "environmentCrn", ENVIRONMENT_CRN, true);
stack.setName("dlStack");
FieldUtils.writeField(stack, "cluster", cluster, true);
StackStatusView stackStatusView = new StackStatusView();
stackStatusView.setStatus(status);
FieldUtils.writeField(stack, "stackStatus", stackStatusView, true);
return stack;
}
use of com.sequenceiq.cloudbreak.domain.view.StackStatusView in project cloudbreak by hortonworks.
the class StackApiViewServiceTest method testCanChangeCredentialHappyPath.
@Test
public void testCanChangeCredentialHappyPath() {
Long stackId = 1L;
StackApiView stackApiView = new StackApiView();
stackApiView.setId(stackId);
StackStatusView stackStatusView = Mockito.mock(StackStatusView.class);
when(stackStatusView.getStatus()).thenReturn(Status.AVAILABLE);
stackApiView.setStackStatus(stackStatusView);
when(flowLogService.isOtherNonTerminationFlowRunning(stackId)).thenReturn(false);
boolean result = stackApiViewService.canChangeCredential(stackApiView);
assertTrue(result);
}
Aggregations