use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertWhenClouderaManagerConversionSuccessfulThenExpectedClouderaManagerV4RequestShouldPlacedIn.
@Test
public void testConvertWhenClouderaManagerConversionSuccessfulThenExpectedClouderaManagerV4RequestShouldPlacedIn() {
ClouderaManagerV4Request expected = mock(ClouderaManagerV4Request.class);
when(clouderaManagerV4RequestConverter.convert(cluster)).thenReturn(expected);
ClusterV4Request result = underTest.convert(cluster);
assertEquals(expected, result.getCm());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertWhenThereIsNoFileSystemThenCloudStorageIsNull.
@Test
public void testConvertWhenThereIsNoFileSystemThenCloudStorageIsNull() {
when(cluster.getFileSystem()).thenReturn(null);
ClusterV4Request result = underTest.convert(cluster);
assertNull(result.getCloudStorage());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertWhenRdsConfigsContainsElementsThenUserManagedOnesNameShouldBeStored.
@Test
public void testConvertWhenRdsConfigsContainsElementsThenUserManagedOnesNameShouldBeStored() {
RDSConfig notUserManaged = new RDSConfig();
notUserManaged.setId(0L);
notUserManaged.setStatus(DEFAULT);
RDSConfig userManaged = new RDSConfig();
notUserManaged.setId(1L);
userManaged.setStatus(USER_MANAGED);
Set<RDSConfig> rdsConfigs = new LinkedHashSet<>(2);
rdsConfigs.add(notUserManaged);
rdsConfigs.add(userManaged);
when(cluster.getRdsConfigs()).thenReturn(rdsConfigs);
ClusterV4Request result = underTest.convert(cluster);
assertEquals(1L, result.getDatabases().size());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class ClusterToClusterV4RequestConverterTest method testConvertWhenRdsConfigIsNotNullButItsEmptyThenRdsConfigNamesShouldBeEmpty.
@Test
public void testConvertWhenRdsConfigIsNotNullButItsEmptyThenRdsConfigNamesShouldBeEmpty() {
when(cluster.getRdsConfigs()).thenReturn(Collections.emptySet());
ClusterV4Request result = underTest.convert(cluster);
assertTrue(result.getDatabases().isEmpty());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request in project cloudbreak by hortonworks.
the class StackCreatorServiceTest method testShouldUseBaseCMImageWithProductsAndCmRepoAndPlatformIsNotYarn.
@Test
public void testShouldUseBaseCMImageWithProductsAndCmRepoAndPlatformIsNotYarn() {
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, AWS_PLATFORM);
assertTrue(base);
}
Aggregations