use of com.sequenceiq.cloudbreak.domain.view.StackStatusView in project cloudbreak by hortonworks.
the class DistroXServiceTest method createDlStackView.
private StackView createDlStackView(Status status) throws IllegalAccessException {
StackView stack = new StackView();
stack.setType(StackType.DATALAKE);
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 testCanChangeCredentialWithStatusIsNotAvailable.
@Test
public void testCanChangeCredentialWithStatusIsNotAvailable() {
StackApiView stackApiView = new StackApiView();
StackStatusView stackStatusView = Mockito.mock(StackStatusView.class);
when(stackStatusView.getStatus()).thenReturn(Status.CREATE_IN_PROGRESS);
stackApiView.setStackStatus(stackStatusView);
boolean result = stackApiViewService.canChangeCredential(stackApiView);
assertFalse(result);
}
use of com.sequenceiq.cloudbreak.domain.view.StackStatusView in project cloudbreak by hortonworks.
the class StackApiViewServiceTest method testCanChangeCredentialWithOngoingFlowOperation.
@Test
public void testCanChangeCredentialWithOngoingFlowOperation() {
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(true);
boolean result = stackApiViewService.canChangeCredential(stackApiView);
assertFalse(result);
}
use of com.sequenceiq.cloudbreak.domain.view.StackStatusView in project cloudbreak by hortonworks.
the class StackListItemToStackApiViewConverter method convert.
public StackApiView convert(StackListItem item, Map<Long, Integer> stackInstanceCounts, List<HostGroupView> hostGroupViews) {
StackApiView response = new StackApiView();
response.setId(item.getId());
response.setResourceCrn(item.getResourceCrn());
response.setName(item.getName());
response.setCloudPlatform(item.getCloudPlatform());
response.setPlatformVariant(item.getPlatformVariant());
response.setCreated(item.getCreated());
StackStatusView stackStatusView = new StackStatusView();
stackStatusView.setStatus(item.getStackStatus());
response.setStackStatus(stackStatusView);
response.setCluster(getClusterApiView(item, hostGroupViews));
response.setNodeCount(stackInstanceCounts.get(item.getId()));
response.setTunnel(item.getTunnel());
response.setEnvironmentCrn(item.getEnvironmentCrn());
response.setType(item.getType());
response.setDatalakeCrn(item.getDatalakeCrn());
response.setUserView(getUserView(item));
response.setTerminated(item.getTerminated());
response.setStackVersion(item.getStackVersion());
response.getCluster().setStack(response);
return response;
}
use of com.sequenceiq.cloudbreak.domain.view.StackStatusView in project cloudbreak by hortonworks.
the class StackStartStopServiceTest method stackViewWithStatus.
private static StackView stackViewWithStatus(Status status) {
StackStatusView stackStatusView = new StackStatusView();
stackStatusView.setStatus(status);
return new StackView(10L, "stackview", "platform", stackStatusView);
}
Aggregations