use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverter method convert.
public DistroXClusterV1Request convert(ClusterV4Request source) {
DistroXClusterV1Request request = new DistroXClusterV1Request();
request.setExposedServices(getIfNotNull(source.getGateway(), gatewayConverter::exposedService));
request.setDatabases(source.getDatabases());
request.setBlueprintName(source.getBlueprintName());
request.setUserName(null);
request.setPassword(null);
request.setCm(getIfNotNull(source.getCm(), cmConverter::convert));
request.setCloudStorage(source.getCloudStorage());
request.setProxy(source.getProxyConfigCrn());
return request;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertClusterV4RequestToDistroXClusterV1RequestThenCloudStorageShouldBeSet.
@Test
void testConvertClusterV4RequestToDistroXClusterV1RequestThenCloudStorageShouldBeSet() {
DistroXClusterV1Request result = underTest.convert(clusterV4RequestInput);
assertNotNull(result);
assertEquals(clusterV4RequestInput.getCloudStorage(), result.getCloudStorage());
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertClusterV4RequestToDistroXClusterV1RequestWhenCmIsNullThenItShouldNotBeSet.
@Test
void testConvertClusterV4RequestToDistroXClusterV1RequestWhenCmIsNullThenItShouldNotBeSet() {
clusterV4RequestInput.setCm(null);
DistroXClusterV1Request result = underTest.convert(clusterV4RequestInput);
assertNotNull(result);
assertNull(result.getCm());
verify(cmConverter, never()).convert(any(ClouderaManagerV4Request.class));
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertClusterV4RequestToDistroXClusterV1RequestThenDatabasesShouldBeSet.
@Test
void testConvertClusterV4RequestToDistroXClusterV1RequestThenDatabasesShouldBeSet() {
DistroXClusterV1Request result = underTest.convert(clusterV4RequestInput);
assertNotNull(result);
assertEquals(clusterV4RequestInput.getDatabases(), result.getDatabases());
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertClusterV4RequestToDistroXClusterV1RequestWhenCmIsNotNullThenItShouldBeSet.
@Test
void testConvertClusterV4RequestToDistroXClusterV1RequestWhenCmIsNotNullThenItShouldBeSet() {
ClouderaManagerV1Request cmConverterResult = new ClouderaManagerV1Request();
when(cmConverter.convert(clusterV4RequestInput.getCm())).thenReturn(cmConverterResult);
DistroXClusterV1Request result = underTest.convert(clusterV4RequestInput);
assertNotNull(result);
assertEquals(cmConverterResult, result.getCm());
verify(cmConverter, times(1)).convert(any(ClouderaManagerV4Request.class));
verify(cmConverter, times(1)).convert(clusterV4RequestInput.getCm());
}
Aggregations