use of com.sequenceiq.cloudbreak.structuredevent.event.CustomConfigurationsDetails in project cloudbreak by hortonworks.
the class CustomConfigurationsToCustomConfigurationsDetailsConverter method convert.
public CustomConfigurationsDetails convert(CustomConfigurations customConfigurations) {
CustomConfigurationsDetails customConfigurationsDetails = new CustomConfigurationsDetails();
customConfigurationsDetails.setId(customConfigurations.getId());
customConfigurationsDetails.setCustomConfigurationsName(customConfigurations.getName());
if (customConfigurations.getConfigurations() != null) {
customConfigurationsDetails.setServices(getServicesList(customConfigurations.getConfigurations()));
customConfigurationsDetails.setRoles(getRolesList(customConfigurations.getConfigurations()));
}
customConfigurationsDetails.setRuntimeVersion(customConfigurations.getRuntimeVersion());
return customConfigurationsDetails;
}
use of com.sequenceiq.cloudbreak.structuredevent.event.CustomConfigurationsDetails in project cloudbreak by hortonworks.
the class CustomConfigurationsToCustomConfigurationsDetailsConverterTest method testConvertEmptyNoNPE.
@Test
void testConvertEmptyNoNPE() {
CustomConfigurations customConfigurations = new CustomConfigurations();
CustomConfigurationsDetails customConfigurationsDetails = underTest.convert(customConfigurations);
assertThat(customConfigurationsDetails).isNotNull();
}
use of com.sequenceiq.cloudbreak.structuredevent.event.CustomConfigurationsDetails in project cloudbreak by hortonworks.
the class CustomConfigurationsToCustomConfigurationsDetailsConverterTest method testConvert.
@Test
void testConvert() {
CustomConfigurations customConfigurations = new CustomConfigurations();
customConfigurations.setId(1L);
customConfigurations.setName("test-name");
customConfigurations.setConfigurations(Sets.newHashSet(new CustomConfigurationProperty("property1", "value1", null, "service1"), new CustomConfigurationProperty("property2", "value2", "role2", "service2"), new CustomConfigurationProperty("property3", "value3", null, "service3"), new CustomConfigurationProperty("property4", "value4", "role4", "service4")));
customConfigurations.setRuntimeVersion("test-runtime-version");
CustomConfigurationsDetails customConfigurationsDetails = underTest.convert(customConfigurations);
assertThat(customConfigurationsDetails).isNotNull();
assertThat(customConfigurationsDetails.getCustomConfigurationsName()).isEqualTo("test-name");
assertThat(customConfigurationsDetails.getId()).isEqualTo(1L);
assertThat(customConfigurationsDetails.getRuntimeVersion()).isEqualTo("test-runtime-version");
assertThat(customConfigurationsDetails.getRoles()).hasSameElementsAs(Lists.newArrayList("role2", "role4"));
assertThat(customConfigurationsDetails.getServices()).hasSameElementsAs(Lists.newArrayList("service1", "service2", "service3", "service4"));
}
use of com.sequenceiq.cloudbreak.structuredevent.event.CustomConfigurationsDetails in project cloudbreak by hortonworks.
the class StackToStackDetailsConverterTest method testConversionWithCustomConfigsAndClusterInstalled.
@Test
public void testConversionWithCustomConfigsAndClusterInstalled() {
// GIVEN
Stack stack = createStack();
Cluster cluster = new Cluster();
CustomConfigurations customConfigurations = new CustomConfigurations();
cluster.setCustomConfigurations(customConfigurations);
stack.setCluster(cluster);
CustomConfigurationsDetails customConfigurationsDetails = new CustomConfigurationsDetails();
Mockito.when(customConfigurationsToCustomConfigurationsDetailsConverter.convert(any(CustomConfigurations.class))).thenReturn(customConfigurationsDetails);
// WHEN
StackDetails actual = underTest.convert(stack);
// THEN
Assertions.assertNotNull(actual.getCustomConfigurations());
Assertions.assertEquals(customConfigurationsDetails, actual.getCustomConfigurations());
}
use of com.sequenceiq.cloudbreak.structuredevent.event.CustomConfigurationsDetails in project cloudbreak by hortonworks.
the class StructuredEventToCDPClusterShapeConverterTest method createCustomConfigurationsDetails.
private CustomConfigurationsDetails createCustomConfigurationsDetails() {
CustomConfigurationsDetails customConfigurationsDetails = new CustomConfigurationsDetails();
customConfigurationsDetails.setServices(List.of("service1", "service2", "service3"));
customConfigurationsDetails.setRoles(List.of("role1", "role2"));
customConfigurationsDetails.setRuntimeVersion("7.2.15");
return customConfigurationsDetails;
}
Aggregations