use of alien4cloud.deployment.DeploymentTopologyDTO in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method The_following_nodes_properties_values_should_be.
@Then("^the following nodes properties values sould be \"(.*?)\"$")
public void The_following_nodes_properties_values_should_be(String expectedValue, Map<String, String> nodesProperties) throws Throwable {
DeploymentTopologyDTO dto = getDTOAndassertNotNull();
for (Entry<String, String> entry : nodesProperties.entrySet()) {
NodeTemplate template = MapUtils.getObject(dto.getTopology().getNodeTemplates(), entry.getKey());
assertNodePropertyValueEquals(template, entry.getValue(), expectedValue);
}
}
use of alien4cloud.deployment.DeploymentTopologyDTO in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method the_the_node_in_the_deployment_topology_should_have_the_capability_s_property_with_value.
@Then("^The the node \"(.*?)\" in the deployment topology should have the capability \"(.*?)\"'s property \"(.*?)\" with value \"(.*?)\"$")
public void the_the_node_in_the_deployment_topology_should_have_the_capability_s_property_with_value(String nodeName, String capabilityName, String propertyName, String expectedPropertyValue) throws Throwable {
DeploymentTopologyDTO dto = getDeploymentTopologyDTO();
NodeTemplate node = dto.getTopology().getNodeTemplates().get(nodeName);
assertCapabilityPropertyValueEquals(node, capabilityName, propertyName, expectedPropertyValue);
}
use of alien4cloud.deployment.DeploymentTopologyDTO in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method getDeploymentTopologyDTO.
private DeploymentTopologyDTO getDeploymentTopologyDTO() throws IOException {
DeploymentTopologyDTO dto = JsonUtil.read(Context.getInstance().getRestResponse(), DeploymentTopologyDTO.class, Context.getJsonMapper()).getData();
assertNotNull(dto);
return dto;
}
use of alien4cloud.deployment.DeploymentTopologyDTO in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method The_deployment_topology_sould_have_the_following_input_properties.
@Then("^the deployment topology should have the following inputs properties$")
public void The_deployment_topology_sould_have_the_following_input_properties(Map<String, String> expectedStringInputProperties) throws Throwable {
DeploymentTopologyDTO dto = getDTOAndassertNotNull();
Map<String, AbstractPropertyValue> expectedInputProperties = Maps.newHashMap();
for (Entry<String, String> inputEntry : expectedStringInputProperties.entrySet()) {
expectedInputProperties.put(inputEntry.getKey(), new ScalarPropertyValue(inputEntry.getValue()));
}
assertPropMapContains(dto.getTopology().getAllInputProperties(), expectedInputProperties);
}
use of alien4cloud.deployment.DeploymentTopologyDTO in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method theNodeInTheDeploymentTopologyShouldHaveThePropertyWithASecretFunctionHavingASecretPath.
@Then("^The node \"([^\"]*)\" in the deployment topology should have the property \"([^\"]*)\" with a secret function having a secret path \"([^\"]*)\"$")
public void theNodeInTheDeploymentTopologyShouldHaveThePropertyWithASecretFunctionHavingASecretPath(String nodeName, String propertyName, String secretPath) throws Throwable {
DeploymentTopologyDTO dto = getDeploymentTopologyDTO();
NodeTemplate node = dto.getTopology().getNodeTemplates().get(nodeName);
FunctionPropertyValue actualPropertyValue = (FunctionPropertyValue) node.getProperties().get(propertyName);
FunctionPropertyValue expectedPropertyValue = new FunctionPropertyValue();
expectedPropertyValue.setFunction(ToscaFunctionConstants.GET_SECRET);
expectedPropertyValue.setParameters(Arrays.asList(secretPath));
Assert.assertEquals(actualPropertyValue, expectedPropertyValue);
}
Aggregations