use of com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn in project cloudbreak by hortonworks.
the class StackOperationsTest method testDeleteWhenForcedTrueThenDeleteCalled.
@Test
public void testDeleteWhenForcedTrueThenDeleteCalled() {
NameOrCrn nameOrCrn = NameOrCrn.ofName(stack.getName());
underTest.delete(nameOrCrn, stack.getWorkspace().getId(), true);
verify(stackCommonService, times(1)).deleteWithKerberosInWorkspace(nameOrCrn, stack.getWorkspace().getId(), true);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn in project cloudbreak by hortonworks.
the class StackOperationsTest method testDeleteWhenForcedFalseThenDeleteCalled.
@Test
public void testDeleteWhenForcedFalseThenDeleteCalled() {
NameOrCrn nameOrCrn = NameOrCrn.ofName(stack.getName());
underTest.delete(nameOrCrn, stack.getWorkspace().getId(), false);
verify(stackCommonService, times(1)).deleteWithKerberosInWorkspace(nameOrCrn, stack.getWorkspace().getId(), false);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn in project cloudbreak by hortonworks.
the class DistroXUpgradeAvailabilityService method checkForUpgrade.
public UpgradeV4Response checkForUpgrade(NameOrCrn nameOrCrn, Long workspaceId, UpgradeV4Request request, String userCrn) {
Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId);
String accountId = Crn.safeFromString(userCrn).getAccountId();
UpgradeV4Response response = stackUpgradeOperations.checkForClusterUpgrade(accountId, stack, workspaceId, request);
List<ImageInfoV4Response> filteredCandidates = filterCandidates(accountId, stack, request, response);
List<ImageInfoV4Response> razValidatedCandidates = validateRangerRazCandidates(accountId, stack, filteredCandidates);
response.setUpgradeCandidates(razValidatedCandidates);
return response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn in project cloudbreak by hortonworks.
the class ClusterRecoveryServiceTest method testIfClusterRecoverable.
@Test
public void testIfClusterRecoverable() {
NameOrCrn stackNameOrCrn = NameOrCrn.ofName(STACK_NAME);
when(stackService.getByNameOrCrnInWorkspace(stackNameOrCrn, WORKSPACE_ID)).thenReturn(STACK);
when(stackStatusService.findAllStackStatusesById(STACK.getId())).thenReturn(stackStatusList);
when(freeipaService.checkFreeipaRunning(STACK.getEnvironmentCrn())).thenReturn(freeIpaStatus);
RecoveryValidationV4Response response = underTest.validateRecovery(WORKSPACE_ID, stackNameOrCrn);
Assertions.assertEquals(expectedRecoveryStatus, response.getStatus());
Assertions.assertEquals(expectedMessage, response.getReason());
}
Aggregations