Search in sources :

Example 21 with ClusterV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.

the class StackV4RequestToGatewayConverterTest method generateStackV4Request.

private StackV4Request generateStackV4Request(GatewayV4Request gateWayJson) {
    ClusterV4Request clusterRequest = new ClusterV4Request();
    clusterRequest.setGateway(gateWayJson);
    StackV4Request source = new StackV4Request();
    source.setName("funnyCluster");
    source.setCluster(clusterRequest);
    return source;
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)

Example 22 with ClusterV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.

the class YcloudHybridCloudTest method validateRequestParameters.

private SdxInternalTestDto validateRequestParameters(TestContext tc, SdxInternalTestDto dto, SdxClient client) {
    assertNotNull(dto);
    SdxInternalClusterRequest sdxRequest = dto.getRequest();
    assertNotNull(sdxRequest);
    StackV4Request stackRequest = sdxRequest.getStackV4Request();
    assertNotNull(stackRequest);
    ClusterV4Request clusterRequest = stackRequest.getCluster();
    assertNotNull(clusterRequest);
    ClouderaManagerV4Request cmRequest = clusterRequest.getCm();
    assertNotNull(cmRequest);
    validateInstanceGroups(stackRequest.getInstanceGroups());
    validateRepository(cmRequest.getRepository());
    validateProducts(cmRequest.getProducts());
    return dto;
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) SdxInternalClusterRequest(com.sequenceiq.sdx.api.model.SdxInternalClusterRequest) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request) ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)

Example 23 with ClusterV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvTheCloudStorageShouldBeSetBasedOnTheInputs.

@Test
void testConvertWithoutEnvTheCloudStorageShouldBeSetBasedOnTheInputs() {
    CloudStorageRequest decoratorResult = new CloudStorageRequest();
    when(cloudStorageDecorator.decorate(distroXV1RequestInput.getCluster().getBlueprintName(), distroXV1RequestInput.getName(), distroXV1RequestInput.getCluster().getCloudStorage(), null)).thenReturn(decoratorResult);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1Request();
    assertNotNull(result);
    assertEquals(decoratorResult, result.getCloudStorage());
    verify(cloudStorageDecorator, times(1)).decorate(any(), any(), any(), any());
    verify(cloudStorageDecorator, times(1)).decorate(distroXV1RequestInput.getCluster().getBlueprintName(), distroXV1RequestInput.getName(), distroXV1RequestInput.getCluster().getCloudStorage(), null);
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) Test(org.junit.jupiter.api.Test)

Example 24 with ClusterV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.

the class DistroXClusterToClusterConverterTest method testConvertWithEnvTheCustomQueueShouldBeSetToNull.

@Test
void testConvertWithEnvTheCustomQueueShouldBeSetToNull() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
    assertNotNull(result);
    assertNull(result.getCustomQueue());
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) Test(org.junit.jupiter.api.Test)

Example 25 with ClusterV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.

the class DistroXClusterToClusterConverterTest method testConvertWithEnvTheValidateBlueprintShouldBeSet.

@Test
void testConvertWithEnvTheValidateBlueprintShouldBeSet() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
    assertNotNull(result);
    assertEquals(distroXV1RequestInput.getCluster().getValidateBlueprint(), result.getValidateBlueprint());
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) Test(org.junit.jupiter.api.Test)

Aggregations

ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)90 Test (org.junit.jupiter.api.Test)59 ClouderaManagerV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)16 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)14 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)14 Test (org.junit.Test)13 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)13 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)12 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)10 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)10 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)9 GatewayV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request)9 ClouderaManagerRepositoryV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.repository.ClouderaManagerRepositoryV4Request)8 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)8 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)8 ClouderaManagerProductV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.product.ClouderaManagerProductV4Request)7 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)7 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)7 List (java.util.List)7 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)6