Search in sources :

Example 31 with NameOrCrn

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);
}
Also used : NameOrCrn(com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn) Test(org.junit.Test)

Example 32 with NameOrCrn

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);
}
Also used : NameOrCrn(com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn) Test(org.junit.Test)

Example 33 with NameOrCrn

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;
}
Also used : UpgradeV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response) ImageInfoV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack)

Example 34 with NameOrCrn

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());
}
Also used : RecoveryValidationV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.recovery.RecoveryValidationV4Response) NameOrCrn(com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn) Test(org.junit.Test)

Aggregations

NameOrCrn (com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn)19 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)11 Test (org.junit.Test)8 StackViewV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Response)7 Test (org.junit.jupiter.api.Test)6 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)4 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)4 UpdateStackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.autoscales.request.UpdateStackV4Request)3 CertificatesRotationV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.CertificatesRotationV4Request)3 InternalUpgradeSettings (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.InternalUpgradeSettings)3 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)3 StackViewV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses)3 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)3 StackStatus (com.sequenceiq.cloudbreak.domain.stack.StackStatus)3 InternalOnly (com.sequenceiq.authorization.annotation.InternalOnly)2 UpdateClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.UpdateClusterV4Request)2 ImageInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)2 CredentialResponse (com.sequenceiq.environment.api.v1.credential.model.response.CredentialResponse)2 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)2 StackImageChangeV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackImageChangeV4Request)1