use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class KerberosBlueprintServiceTest method testExtendBlueprintWithKerberosManagedKerberos.
@Test
public void testExtendBlueprintWithKerberosManagedKerberos() throws IOException {
String blueprintText = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-not-kerberized.bp");
Blueprint blueprint = TestUtil.blueprint("name", blueprintText);
Stack stack = TestUtil.stack();
Cluster cluster = TestUtil.cluster(blueprint, stack, 1L, TestUtil.kerberosConfig());
GeneralClusterConfigs generalClusterConfigs = BlueprintTestUtil.generalClusterConfigs();
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("test-1-1"));
generalClusterConfigs.setGatewayInstanceMetadataPresented(false);
BlueprintPreparationObject object = BlueprintPreparationObject.Builder.builder().withKerberosConfig(cluster.getKerberosConfig()).withGeneralClusterConfigs(generalClusterConfigs).build();
BlueprintTextProcessor b = new BlueprintTextProcessor(blueprint.getBlueprintText());
String actualBlueprint = underTest.customTextManipulation(object, b).asText();
String expectedBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-not-kerberized-cloudbreak-managed-expected.bp");
JsonNode expectedNode = JsonUtil.readTree(expectedBlueprint);
JsonNode resultNode = JsonUtil.readTree(actualBlueprint);
Assert.assertEquals(expectedNode, resultNode);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class KerberosBlueprintServiceTest method testExtendBlueprintWithKerberosExisting.
@Test
public void testExtendBlueprintWithKerberosExisting() throws IOException {
String blueprintText = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-not-kerberized.bp");
Blueprint blueprint = TestUtil.blueprint("name", blueprintText);
KerberosConfig kerberosConfig = new KerberosConfig();
kerberosConfig.setPrincipal("principal.conf");
kerberosConfig.setPrincipal("passwd.conf");
kerberosConfig.setUrl("url.conf");
kerberosConfig.setAdminUrl("adminUrl.conf");
kerberosConfig.setRealm("realm.conf");
kerberosConfig.setLdapUrl("ldapUrl.conf");
kerberosConfig.setContainerDn("containerDn.conf");
kerberosConfig.setTcpAllowed(true);
Stack stack = TestUtil.stack();
GeneralClusterConfigs generalClusterConfigs = BlueprintTestUtil.generalClusterConfigs();
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("test-1-1"));
generalClusterConfigs.setGatewayInstanceMetadataPresented(false);
Cluster cluster = TestUtil.cluster(blueprint, stack, 1L, kerberosConfig);
BlueprintPreparationObject object = BlueprintPreparationObject.Builder.builder().withKerberosConfig(cluster.getKerberosConfig()).withGeneralClusterConfigs(generalClusterConfigs).build();
BlueprintTextProcessor b = new BlueprintTextProcessor(blueprint.getBlueprintText());
String actualBlueprint = underTest.customTextManipulation(object, b).asText();
String expectedBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-not-kerberized-existing-expected.bp");
JsonNode expectedNode = JsonUtil.readTree(expectedBlueprint);
JsonNode resultNode = JsonUtil.readTree(actualBlueprint);
Assert.assertEquals(expectedNode, resultNode);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class CentralBlueprintUpdaterNegativeInputTest method testForMissingHostGroupNodeInBlueprint.
@Test
public void testForMissingHostGroupNodeInBlueprint() throws IOException {
expectedException.expect(BlueprintProcessingException.class);
BlueprintPreparationObject model = getExtendedPreparedBlueprintBuilder("missing-hostgroups.bp").build();
getUnderTest().getBlueprintText(model);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class CentralBlueprintUpdaterNegativeInputTest method testForNotExistingHostGroupNameComesFromModel.
@Test
public void testForNotExistingHostGroupNameComesFromModel() throws IOException {
String dummyHostGroupName = "dummy";
expectedException.expect(BlueprintProcessingException.class);
expectedException.expectMessage(String.format("There is no such host group as \"%s\"", dummyHostGroupName));
BlueprintPreparationObject model = getExtendedPreparedBlueprintBuilder("wrong-hostnames-in-model.bp", dummyHostGroupName).build();
getUnderTest().getBlueprintText(model);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject in project cloudbreak by hortonworks.
the class CentralBlueprintUpdaterRollingtest method prepareBlueprintPreparationObjectWithBlueprintText.
private BlueprintPreparationObject prepareBlueprintPreparationObjectWithBlueprintText() {
BlueprintPreparationObject blueprintPreparationObject = params.value().getModel();
blueprintPreparationObject.getBlueprintView().setBlueprintText(params.value().getInput().getFileContent());
return blueprintPreparationObject;
}
Aggregations