Search in sources :

Example 1 with ClouderaManagerV1Request

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());
}
Also used : DistroXClusterV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request) ClouderaManagerV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request) ClouderaManagerV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request) Test(org.junit.jupiter.api.Test)

Example 2 with ClouderaManagerV1Request

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;
}
Also used : ClouderaManagerV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request)

Example 3 with ClouderaManagerV1Request

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;
}
Also used : ClouderaManagerRepositoryV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.repository.ClouderaManagerRepositoryV1Request) DistroXClusterV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request) ClouderaManagerV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request)

Example 4 with ClouderaManagerV1Request

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;
}
Also used : ClouderaManagerV1Request(com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request)

Aggregations

ClouderaManagerV1Request (com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.ClouderaManagerV1Request)4 DistroXClusterV1Request (com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXClusterV1Request)2 ClouderaManagerV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)1 ClouderaManagerRepositoryV1Request (com.sequenceiq.distrox.api.v1.distrox.model.cluster.cm.repository.ClouderaManagerRepositoryV1Request)1 Test (org.junit.jupiter.api.Test)1