use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.
the class StackCreatorServiceTest method testShouldUseBaseCMImageWithProductsAndPlatformIsYarn.
@Test
public void testShouldUseBaseCMImageWithProductsAndPlatformIsYarn() {
ClusterV4Request clusterV4Request = new ClusterV4Request();
ClouderaManagerV4Request cmRequest = new ClouderaManagerV4Request();
ClouderaManagerProductV4Request cdpRequest = new ClouderaManagerProductV4Request();
cdpRequest.setName("CDP");
cdpRequest.setParcel("parcel");
cdpRequest.setVersion("version");
cdpRequest.setCsd(List.of("csd"));
cmRequest.setProducts(List.of(cdpRequest));
clusterV4Request.setCm(cmRequest);
boolean base = underTest.shouldUseBaseCMImage(clusterV4Request, YARN_PLATFORM);
assertTrue(base);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.
the class StackCreatorServiceTest method testShouldUseBaseCMImageShouldReturnTrueWithCMImageWithCmRepoAndImageIsNotPresentAndPlatformIsNotYarn.
@Test
public void testShouldUseBaseCMImageShouldReturnTrueWithCMImageWithCmRepoAndImageIsNotPresentAndPlatformIsNotYarn() {
ClusterV4Request clusterV4Request = new ClusterV4Request();
ClouderaManagerV4Request cmRequest = new ClouderaManagerV4Request();
ClouderaManagerRepositoryV4Request cmRepoRequest = new ClouderaManagerRepositoryV4Request();
cmRequest.setRepository(cmRepoRequest);
clusterV4Request.setCm(cmRequest);
boolean base = underTest.shouldUseBaseCMImage(clusterV4Request, AWS_PLATFORM);
assertTrue(base);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.
the class YcloudHybridCloudTest method validateRequestParameters.
private SdxInternalTestDto validateRequestParameters(TestContext tc, SdxInternalTestDto dto, SdxClient client) {
assertNotNull(dto);
SdxInternalClusterRequest sdxRequest = dto.getRequest();
assertNotNull(sdxRequest);
StackV4Request stackRequest = sdxRequest.getStackV4Request();
assertNotNull(stackRequest);
ClusterV4Request clusterRequest = stackRequest.getCluster();
assertNotNull(clusterRequest);
ClouderaManagerV4Request cmRequest = clusterRequest.getCm();
assertNotNull(cmRequest);
validateInstanceGroups(stackRequest.getInstanceGroups());
validateRepository(cmRequest.getRepository());
validateProducts(cmRequest.getProducts());
return dto;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.
the class DistroXClusterToClusterConverterTest method testConvertWithoutEnvCmConversionShouldHappenIfInputCmIsNotNull.
@Test
void testConvertWithoutEnvCmConversionShouldHappenIfInputCmIsNotNull() {
ClouderaManagerV4Request cmConversionResult = new ClouderaManagerV4Request();
when(cmConverter.convert(distroXV1RequestInput.getCluster().getCm())).thenReturn(cmConversionResult);
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
ClusterV4Request result = testConvertDistroXV1Request();
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.cm.ClouderaManagerV4Request in project cloudbreak by hortonworks.
the class ClouderaManagerV1ToClouderaManagerV4Converter method convert.
public ClouderaManagerV4Request convert(ClouderaManagerV1Request source) {
ClouderaManagerV4Request response = new ClouderaManagerV4Request();
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