Search in sources :

Example 66 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvTheCustomQueueShouldBeSetToNull.

@Test
void testConvertWithoutEnvTheCustomQueueShouldBeSetToNull() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1Request();
    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 67 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvCmConversionShouldNotHappenIfInputCmIsNull.

@Test
void testConvertWithoutEnvCmConversionShouldNotHappenIfInputCmIsNull() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    distroXV1RequestInput.getCluster().setCm(null);
    ClusterV4Request result = testConvertDistroXV1Request();
    assertNotNull(result);
    assertNull(result.getCm());
    verify(cmConverter, never()).convert(any(ClouderaManagerV1Request.class));
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) ClouderaManagerV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request) Test(org.junit.jupiter.api.Test)

Example 68 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvTheValidateBlueprintShouldBeSet.

@Test
void testConvertWithoutEnvTheValidateBlueprintShouldBeSet() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1Request();
    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)

Example 69 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithEnvTheNameShouldBeSetToNull.

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

Example 70 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method createClusterV4Request.

private ClusterV4Request createClusterV4Request() {
    ClusterV4Request r = new ClusterV4Request();
    r.setBlueprintName("someBlueprint");
    r.setGateway(createGatewayV4Request());
    r.setDatabases(Set.of("DB1", "DB2"));
    r.setUserName("someUserName");
    r.setPassword("somePassword");
    r.setCm(createClouderaManagerV4Request());
    r.setCloudStorage(createCloudStorageRequest());
    r.setProxyConfigCrn("someProxyConfigCrn");
    return r;
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)

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