Search in sources :

Example 31 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvTheDatabasesShouldBeSet.

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

Example 32 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithEnvTheCloudStorageShouldBeSetBasedOnTheInputs.

@Test
void testConvertWithEnvTheCloudStorageShouldBeSetBasedOnTheInputs() {
    CloudStorageRequest decoratorResult = new CloudStorageRequest();
    when(cloudStorageDecorator.decorate(distroXV1RequestInput.getCluster().getBlueprintName(), distroXV1RequestInput.getName(), distroXV1RequestInput.getCluster().getCloudStorage(), env)).thenReturn(decoratorResult);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
    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(), env);
}
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 33 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvTheUsernameShouldBeSet.

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

Example 34 with ClusterV4Request

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

the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvWhenExposedServiceIsNotEmptyThenItShouldBeConverted.

@Test
void testConvertWithoutEnvWhenExposedServiceIsNotEmptyThenItShouldBeConverted() {
    GatewayV4Request gr = new GatewayV4Request();
    when(gatewayConverter.convert(distroXV1RequestInput.getCluster().getExposedServices())).thenReturn(gr);
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    ClusterV4Request result = testConvertDistroXV1Request();
    assertNotNull(result);
    assertEquals(gr, result.getGateway());
    verify(gatewayConverter, times(1)).convert(anyList());
    verify(gatewayConverter, times(1)).convert(distroXV1RequestInput.getCluster().getExposedServices());
}
Also used : GatewayV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request) ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) Test(org.junit.jupiter.api.Test)

Example 35 with ClusterV4Request

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

the class RdsConfigValidatorTest method acceptsNoDatabases.

@Test
public void acceptsNoDatabases() {
    ClusterV4Request request = requestWithDatabases();
    subject.validateRdsConfigs(request, null, workspace);
}
Also used : ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) Test(org.junit.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