Search in sources :

Example 6 with DeploymentTopologyDTO

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);
    }
}
Also used : NodeTemplate(org.alien4cloud.tosca.model.templates.NodeTemplate) DeploymentTopologyDTO(alien4cloud.deployment.DeploymentTopologyDTO) Then(cucumber.api.java.en.Then)

Example 7 with DeploymentTopologyDTO

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);
}
Also used : NodeTemplate(org.alien4cloud.tosca.model.templates.NodeTemplate) DeploymentTopologyDTO(alien4cloud.deployment.DeploymentTopologyDTO) Then(cucumber.api.java.en.Then)

Example 8 with DeploymentTopologyDTO

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;
}
Also used : DeploymentTopologyDTO(alien4cloud.deployment.DeploymentTopologyDTO)

Example 9 with DeploymentTopologyDTO

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);
}
Also used : ScalarPropertyValue(org.alien4cloud.tosca.model.definitions.ScalarPropertyValue) DeploymentTopologyDTO(alien4cloud.deployment.DeploymentTopologyDTO) AbstractPropertyValue(org.alien4cloud.tosca.model.definitions.AbstractPropertyValue) Then(cucumber.api.java.en.Then)

Example 10 with DeploymentTopologyDTO

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);
}
Also used : NodeTemplate(org.alien4cloud.tosca.model.templates.NodeTemplate) FunctionPropertyValue(org.alien4cloud.tosca.model.definitions.FunctionPropertyValue) DeploymentTopologyDTO(alien4cloud.deployment.DeploymentTopologyDTO) Then(cucumber.api.java.en.Then)

Aggregations

DeploymentTopologyDTO (alien4cloud.deployment.DeploymentTopologyDTO)27 Then (cucumber.api.java.en.Then)13 Application (alien4cloud.model.application.Application)8 ApiOperation (io.swagger.annotations.ApiOperation)8 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)8 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 ApplicationEnvironment (alien4cloud.model.application.ApplicationEnvironment)7 ApplicationTopologyVersion (alien4cloud.model.application.ApplicationTopologyVersion)7 DeploymentTopology (alien4cloud.model.deployment.DeploymentTopology)7 Topology (org.alien4cloud.tosca.model.templates.Topology)7 Audit (alien4cloud.audit.annotation.Audit)6 NodeTemplate (org.alien4cloud.tosca.model.templates.NodeTemplate)5 ConstraintFunctionalException (org.alien4cloud.tosca.exceptions.ConstraintFunctionalException)4 ConstraintTechnicalException (org.alien4cloud.tosca.exceptions.ConstraintTechnicalException)4 FunctionPropertyValue (org.alien4cloud.tosca.model.definitions.FunctionPropertyValue)3 Context (alien4cloud.it.Context)2 AbstractLocationResourceTemplate (alien4cloud.model.orchestrators.locations.AbstractLocationResourceTemplate)2 LocationResourceTemplate (alien4cloud.model.orchestrators.locations.LocationResourceTemplate)2 RestError (alien4cloud.rest.model.RestError)2 RestResponse (alien4cloud.rest.model.RestResponse)2