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());
}
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);
}
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());
}
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());
}
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);
}
Aggregations