use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class HadoopConfigurationServiceTest method testConfigure.
@Test
public void testConfigure() throws IOException {
BlueprintPreparationObject source = Builder.builder().build();
BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
when(configService.getHostGroupConfiguration(blueprintTextProcessor, source.getHostgroupViews())).thenReturn(emptyMap());
when(configService.getComponentsByHostGroup(blueprintTextProcessor, source.getHostgroupViews())).thenReturn(emptyMap());
when(blueprintTextProcessor.extendBlueprintHostGroupConfiguration(any(HostgroupConfigurations.class), anyBoolean())).thenReturn(blueprintTextProcessor);
when(blueprintTextProcessor.extendBlueprintGlobalConfiguration(any(SiteConfigurations.class), anyBoolean())).thenReturn(blueprintTextProcessor);
BlueprintTextProcessor actual = underTest.customTextManipulation(source, blueprintTextProcessor);
Assert.assertEquals(blueprintTextProcessor, actual);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class HadoopConfigurationServiceTest method testAdditionalCriteriaWhenTrue.
@Test
public void testAdditionalCriteriaWhenTrue() {
BlueprintPreparationObject source = Builder.builder().withBlueprintView(new BlueprintView("blueprintText", "2.5", "HDP")).build();
boolean actual = underTest.additionalCriteria(source, "blueprintText");
Assert.assertTrue(actual);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class HbaseConfigProviderTest method testCustomTextManipulationWhenThereAreNoMissingHbaseClients.
@Test
public void testCustomTextManipulationWhenThereAreNoMissingHbaseClients() throws IOException {
String blueprintText = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-kerberized-test.bp");
BlueprintPreparationObject object = BlueprintPreparationObject.Builder.builder().build();
Set<String> masters = Sets.newHashSet("master", "slave_1", "slave_2", "compute");
Set<String> clients = Sets.newHashSet("master", "slave_1", "slave_2", "compute");
Set<String> missing = Sets.newHashSet();
when(blueprintProcessor.getHostGroupsWithComponent("HBASE_MASTER")).thenReturn(masters);
when(blueprintProcessor.getHostGroupsWithComponent("HBASE_CLIENT")).thenReturn(clients);
when(blueprintProcessor.addComponentToHostgroups("HBASE_CLIENT", missing)).thenReturn(blueprintProcessor);
when(blueprintProcessor.asText()).thenReturn(blueprintText);
when(blueprintProcessorFactory.get(anyString())).thenReturn(blueprintProcessor);
String result = underTest.customTextManipulation(object, blueprintProcessor).asText();
Assert.assertEquals(blueprintText, result);
verify(blueprintProcessor, times(1)).getHostGroupsWithComponent("HBASE_MASTER");
verify(blueprintProcessor, times(1)).getHostGroupsWithComponent("HBASE_CLIENT");
verify(blueprintProcessor, times(0)).addComponentToHostgroups("HBASE_CLIENT", missing);
}
Aggregations