use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method I_substitute_on_the_current_application_the_policy_with_the_location_resource.
@When("^I substitute on the current application the policy \"(.*?)\" with the location resource \"(.*?)\"/\"(.*?)\"/\"(.*?)\"$")
public void I_substitute_on_the_current_application_the_policy_with_the_location_resource(String policyName, String orchestratorName, String locationName, String resourceName) throws Throwable {
Context context = Context.getInstance();
String orchestratorId = context.getOrchestratorId(orchestratorName);
String locationId = context.getLocationId(orchestratorId, locationName);
String resourceId = context.getLocationResourceId(orchestratorId, locationId, resourceName);
doPolicySubstitution(policyName, resourceId);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class DeploymentTopologyStepDefinitions method iUpdateThePropertyToASecretWithASecretPathForTheSubstitutedPolicy.
@When("^I update the property \"([^\"]*)\" to a secret with a secret path \"([^\"]*)\" for the substituted policy \"([^\"]*)\"$")
public void iUpdateThePropertyToASecretWithASecretPathForTheSubstitutedPolicy(String propertyName, String secretPath, String nodeName) throws Throwable {
FunctionPropertyValue propertyValue = new FunctionPropertyValue();
propertyValue.setFunction(ToscaFunctionConstants.GET_SECRET);
propertyValue.setParameters(Arrays.asList(secretPath));
updateProperty(propertyName, propertyValue, nodeName, "/rest/v1/applications/%s/environments/%s/deployment-topology/policies/%s/substitution/properties");
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class InputPropertiesStepDefinitions method I_define_the_property_of_the_node_as_of_typeId_as_input_property.
@When("^I define the property \"([^\"]*)\" of the node \"([^\"]*)\" of typeId \"([^\"]*)\" as input property$")
public void I_define_the_property_of_the_node_as_of_typeId_as_input_property(String inputId, String nodeName, String typeId) throws Throwable {
// get the component to use the right property definition
String componentResponse = Context.getRestClientInstance().get("/rest/v1/components/" + typeId);
RestResponse<NodeType> componentResult = JsonUtil.read(componentResponse, NodeType.class, Context.getJsonMapper());
PropertyDefinition propertyDefinition = componentResult.getData().getProperties().get(inputId);
String fullUrl = String.format("/rest/v1/topologies/%s/inputs/%s", Context.getInstance().getTopologyId(), inputId);
String json = JsonUtil.toString(propertyDefinition);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon(fullUrl, json));
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class InputPropertiesStepDefinitions method I_define_the_property_of_the_node_as_input_property.
@When("^I define the property \"([^\"]*)\" of the node \"([^\"]*)\" as input property$")
public void I_define_the_property_of_the_node_as_input_property(String inputId, String nodeName) throws Throwable {
// get the topologyTDO to have the real type of the propertyDefinition
PropertyDefinition propertyDefinition = getPropertyDefinition(nodeName, inputId);
AddInputOperation addInputOperation = new AddInputOperation();
addInputOperation.setPropertyDefinition(propertyDefinition);
addInputOperation.setInputName(inputId);
EditorStepDefinitions.do_i_execute_the_operation(addInputOperation);
SetNodePropertyAsInputOperation setNodePropertyAsInputOperation = new SetNodePropertyAsInputOperation();
setNodePropertyAsInputOperation.setInputName(inputId);
setNodePropertyAsInputOperation.setPropertyName(inputId);
setNodePropertyAsInputOperation.setNodeName(nodeName);
EditorStepDefinitions.do_i_execute_the_operation(setNodePropertyAsInputOperation);
EditorStepDefinitions.do_i_save_the_topology();
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class SecretPropertiesStepDefinitions method iDefineThePropertyOfCapabilityOfTheNodeAsSecretWithASecretPath.
@When("^I define the property \"([^\"]*)\" of capability \"([^\"]*)\" of the node \"([^\"]*)\" as secret with a secret path \"([^\"]*)\"$")
public void iDefineThePropertyOfCapabilityOfTheNodeAsSecretWithASecretPath(String propertyName, String capabilityName, String nodeName, String secretPath) throws Throwable {
SetNodeCapabilityPropertyAsSecretOperation operation = new SetNodeCapabilityPropertyAsSecretOperation();
operation.setNodeName(nodeName);
operation.setPropertyName(propertyName);
operation.setSecretPath(secretPath);
operation.setCapabilityName(capabilityName);
EditorStepDefinitions.do_i_execute_the_operation(operation);
}
Aggregations