use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertWhenRdsConfigNullThenRdsConfigNamesShouldBeEmpty.
@Test
public void testConvertWhenRdsConfigNullThenRdsConfigNamesShouldBeEmpty() {
when(cluster.getRdsConfigs()).thenReturn(null);
ClusterV4Request result = underTest.convert(cluster);
assertTrue(result.getDatabases().isEmpty());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertNameIsPassedProperly.
@Test
public void testConvertNameIsPassedProperly() {
String expected = "name";
when(cluster.getName()).thenReturn(expected);
ClusterV4Request result = underTest.convert(cluster);
assertEquals(expected, result.getName());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertWhenProxyConfigNotNullThenProxyConfigNameShouldBePassed.
@Test
public void testConvertWhenProxyConfigNotNullThenProxyConfigNameShouldBePassed() {
String expected = "proxy name value";
when(cluster.getProxyConfigCrn()).thenReturn(expected);
ClusterV4Request result = underTest.convert(cluster);
assertEquals(expected, result.getProxyConfigCrn());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithEnvWhenExposedServiceIsNotEmptyThenItShouldBeConverted.
@Test
void testConvertWithEnvWhenExposedServiceIsNotEmptyThenItShouldBeConverted() {
GatewayV4Request gr = new GatewayV4Request();
when(gatewayConverter.convert(distroXV1RequestInput.getCluster().getExposedServices())).thenReturn(gr);
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1RequestWithEnvironment();
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 DistroXClusterToClusterConverterTest method testConvertWithoutEnvTheCustomContainerShouldBeSetToNull.
@Test
void testConvertWithoutEnvTheCustomContainerShouldBeSetToNull() {
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1Request();
assertNotNull(result);
assertNull(result.getCustomContainer());
}
Aggregations