use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class StackCreatorServiceTest method testShouldUseBaseCMImageShouldReturnTrueWhenCmRequestIsNotPresentAndPlatformIsYarn.
@Test
public void testShouldUseBaseCMImageShouldReturnTrueWhenCmRequestIsNotPresentAndPlatformIsYarn() {
ClusterV4Request clusterV4Request = new ClusterV4Request();
boolean actual = underTest.shouldUseBaseCMImage(clusterV4Request, YARN_PLATFORM);
assertTrue(actual);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class StackCreatorServiceTest method testShouldUseBaseCMImageWithProductsAndPlatformIsNotYarn.
@Test
public void testShouldUseBaseCMImageWithProductsAndPlatformIsNotYarn() {
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, AWS_PLATFORM);
assertTrue(base);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class StackCreatorServiceTest method testShouldUseBaseCMImageWithProductsAndCmRepoAndPlatformIsYarn.
@Test
public void testShouldUseBaseCMImageWithProductsAndCmRepoAndPlatformIsYarn() {
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));
ClouderaManagerRepositoryV4Request cmRepoRequest = new ClouderaManagerRepositoryV4Request();
cmRequest.setRepository(cmRepoRequest);
clusterV4Request.setCm(cmRequest);
boolean base = underTest.shouldUseBaseCMImage(clusterV4Request, YARN_PLATFORM);
assertTrue(base);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterCreationEnvironmentValidatorTest method testAutoTlsConfigurations.
// CHECKSTYLE:ON
// @formatter:on
@ParameterizedTest(name = "{0}")
@MethodSource("autoTlsConfigurations")
@MockitoSettings(strictness = Strictness.LENIENT)
void testAutoTlsConfigurations(String testName, boolean cmAutoTls, boolean providerAutoTls, boolean expectedHasErrors) {
// GIVEN
Stack stack = getStack();
ClusterV4Request clusterRequest = new ClusterV4Request();
ClouderaManagerV4Request cmRequest = new ClouderaManagerV4Request();
cmRequest.setEnableAutoTls(cmAutoTls);
clusterRequest.setCm(cmRequest);
DetailedEnvironmentResponse environment = getEnvironmentResponse();
when(platformParameters.isAutoTlsSupported()).thenReturn(providerAutoTls);
when(sdxClientService.getByEnvironmentCrn(any())).thenReturn(Arrays.asList(new SdxClusterResponse()));
ValidationResult.ValidationResultBuilder validationBuilder = ValidationResult.builder();
// WHEN
underTest.validateAutoTls(clusterRequest, stack, validationBuilder, environment.getParentEnvironmentCloudPlatform());
// THEN
ValidationResult actualResult = validationBuilder.build();
assertEquals(expectedHasErrors, actualResult.hasError());
if (expectedHasErrors) {
assertEquals(1, actualResult.getErrors().size());
assertTrue(actualResult.getErrors().contains("AutoTLS is not supported by 'aws' platform!"));
}
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class RdsConfigValidatorTest method requestWithDatabases.
private ClusterV4Request requestWithDatabases(DatabaseType... databaseTypes) {
List<RDSConfig> rdsConfigs = Arrays.stream(databaseTypes).map(TestUtil::rdsConfig).collect(toList());
rdsConfigs.forEach(each -> when(rdsConfigService.getByNameForWorkspace(each.getName(), workspace)).thenReturn(each));
ClusterV4Request request = new ClusterV4Request();
request.setDatabases(rdsConfigs.stream().map(RDSConfig::getName).collect(toSet()));
return request;
}
Aggregations