Search in sources :

Example 6 with StackStatusView

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;
}
Also used : ClusterView(com.sequenceiq.cloudbreak.domain.view.ClusterView) StackStatusView(com.sequenceiq.cloudbreak.domain.view.StackStatusView) StackView(com.sequenceiq.cloudbreak.domain.view.StackView)

Example 7 with StackStatusView

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);
}
Also used : StackApiView(com.sequenceiq.cloudbreak.domain.view.StackApiView) StackStatusView(com.sequenceiq.cloudbreak.domain.view.StackStatusView) Test(org.junit.Test)

Aggregations

StackStatusView (com.sequenceiq.cloudbreak.domain.view.StackStatusView)7 StackApiView (com.sequenceiq.cloudbreak.domain.view.StackApiView)4 StackView (com.sequenceiq.cloudbreak.domain.view.StackView)3 Test (org.junit.Test)3 ClusterView (com.sequenceiq.cloudbreak.domain.view.ClusterView)1