use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request 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());
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method createClouderaManagerV1Request.
private ClouderaManagerV1Request createClouderaManagerV1Request() {
ClouderaManagerV1Request r = new ClouderaManagerV1Request();
r.setRepository(createClouderaManagerRepositoryV1Request());
r.setProducts(List.of(createClouderaManagerProductV1Request()));
r.setEnableAutoTls(true);
return r;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request in project cloudbreak by hortonworks.
the class DistroXTemplateTestDto method withCluster.
private DistroXTemplateTestDto withCluster(ClusterV4Request clusterV4Request) {
DistroXClusterV1Request cluster = new DistroXClusterV1Request();
cluster.setBlueprintName(clusterV4Request.getBlueprintName());
ClouderaManagerV1Request cm = new ClouderaManagerV1Request();
ClouderaManagerRepositoryV1Request repository = new ClouderaManagerRepositoryV1Request();
cm.setRepository(repository);
cluster.setCm(cm);
cluster.setUserName(clusterV4Request.getUserName());
cluster.setPassword(clusterV4Request.getPassword());
getRequest().setCluster(cluster);
return this;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request in project cloudbreak by hortonworks.
the class ClouderaManagerV1ToClouderaManagerV4Converter method convert.
public ClouderaManagerV1Request convert(ClouderaManagerV4Request source) {
ClouderaManagerV1Request response = new ClouderaManagerV1Request();
doIfNotNull(source.getProducts(), products -> response.setProducts(products.stream().map(this::convertProduct).collect(Collectors.toList())));
response.setRepository(getIfNotNull(source.getRepository(), repositoryConverter::convert));
response.setEnableAutoTls(source.getEnableAutoTls());
return response;
}
Aggregations