use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithEnvThePasswordShouldBeSet.
@Test
void testConvertWithEnvThePasswordShouldBeSet() {
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
assertNotNull(result);
assertEquals(distroXV1RequestInput.getCluster().getPassword(), result.getPassword());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithEnvCmConversionShouldHappenIfInputCmIsNotNull.
@Test
void testConvertWithEnvCmConversionShouldHappenIfInputCmIsNotNull() {
ClouderaManagerV4Request cmConversionResult = new ClouderaManagerV4Request();
when(cmConverter.convert(distroXV1RequestInput.getCluster().getCm())).thenReturn(cmConversionResult);
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
assertNotNull(result);
assertEquals(cmConversionResult, result.getCm());
verify(cmConverter, times(1)).convert(any(ClouderaManagerV1Request.class));
verify(cmConverter, times(1)).convert(distroXV1RequestInput.getCluster().getCm());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvThePasswordShouldBeSet.
@Test
void testConvertWithoutEnvThePasswordShouldBeSet() {
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1Request();
assertNotNull(result);
assertEquals(distroXV1RequestInput.getCluster().getPassword(), result.getPassword());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithEnvTheBlueprintNameShouldBeSet.
@Test
void testConvertWithEnvTheBlueprintNameShouldBeSet() {
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
assertNotNull(result);
assertEquals(distroXV1RequestInput.getCluster().getBlueprintName(), result.getBlueprintName());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithEnvWhenExposedServiceIsEmptyThenAllShouldBeConverted.
@Test
void testConvertWithEnvWhenExposedServiceIsEmptyThenAllShouldBeConverted() {
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
distroXV1RequestInput.getCluster().setExposedServices(new ArrayList<>(0));
GatewayV4Request gr = new GatewayV4Request();
when(gatewayConverter.convert(List.of("ALL"))).thenReturn(gr);
ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
assertNotNull(result);
assertEquals(gr, result.getGateway());
verify(gatewayConverter, times(1)).convert(anyList());
verify(gatewayConverter, times(1)).convert(List.of("ALL"));
}
Aggregations