use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method iUpdateTheDeploymentWithTheFollowingCredentialsDefinedByTheSecretProviderPlugin.
@When("^I update the deployment with the following credentials defined by the secret provider plugin \"([^\"]*)\"$")
public void iUpdateTheDeploymentWithTheFollowingCredentialsDefinedByTheSecretProviderPlugin(String pluginName, DataTable table) throws Throwable {
SecretProviderCredentials secretProviderCredentials = new SecretProviderCredentials();
secretProviderCredentials.setPluginName(pluginName);
secretProviderCredentials.setCredentials(DataTableUtils.dataTableToMap(table));
doUpdateDeployment(ApplicationStepDefinitions.CURRENT_APPLICATION.getName(), null, secretProviderCredentials);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method iDeployItWithTheFollowingCredentialsDefinedByTheSecretProviderPlugin.
@When("^I deploy it with the following credentials defined by the secret provider plugin \"([^\"]*)\"$")
public void iDeployItWithTheFollowingCredentialsDefinedByTheSecretProviderPlugin(String pluginName, DataTable table) throws Throwable {
DeployApplicationRequest deployApplicationRequest = getDeploymentAppRequest(ApplicationStepDefinitions.CURRENT_APPLICATION.getName(), null);
deployApplicationRequest.setSecretProviderCredentials(DataTableUtils.dataTableToMap(table));
deployApplicationRequest.setSecretProviderPluginName(pluginName);
String response = deploy(deployApplicationRequest);
Context.getInstance().registerRestResponse(response);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class ApplicationStepDefinitions method I_update_the_application_environment_named_with_values.
@When("^I update the application environment named \"([^\"]*)\" with values$")
public void I_update_the_application_environment_named_with_values(String applicationEnvironmentName, DataTable appEnvAttributeValues) throws Throwable {
UpdateApplicationEnvironmentRequest appEnvRequest = new UpdateApplicationEnvironmentRequest();
String attribute = null, attributeValue = null;
for (List<String> attributesToUpdate : appEnvAttributeValues.raw()) {
attribute = attributesToUpdate.get(0);
attributeValue = attributesToUpdate.get(1);
switch(attribute) {
case "name":
appEnvRequest.setName(attributeValue);
break;
case "description":
appEnvRequest.setDescription(attributeValue);
break;
case "environmentType":
appEnvRequest.setEnvironmentType(EnvironmentType.valueOf(attributeValue));
break;
case "currentVersionId":
appEnvRequest.setCurrentVersionId(attributeValue);
break;
default:
log.info("Attribute [ {} ] not found in ApplicationEnvironmentRequest object", attribute);
break;
}
}
String environmentId = Context.getInstance().getApplicationEnvironmentId(CURRENT_APPLICATION.getName(), applicationEnvironmentName);
// send the update request
Context.getInstance().registerRestResponse(getRestClientInstance().putJSon("/rest/v1/applications/" + CURRENT_APPLICATION.getId() + "/environments/" + environmentId, JsonUtil.toString(appEnvRequest)));
if (StringUtils.isNotBlank(appEnvRequest.getName())) {
Context.getInstance().registerApplicationEnvironmentId(CURRENT_APPLICATION.getId(), appEnvRequest.getName(), environmentId);
}
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class ApplicationStepDefinitions method I_search_applications_from_with_result_size_of.
@When("^I search applications from (\\d+) with result size of (\\d+)$")
public void I_search_applications_from_with_result_size_of(int from, int to) throws Throwable {
FilteredSearchRequest searchRequest = new FilteredSearchRequest("", from, to, null);
previousRestResponse = Context.getInstance().getRestResponse();
Context.getInstance().registerRestResponse(getRestClientInstance().postJSon("/rest/v1/applications/search", JsonUtil.toString(searchRequest)));
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class DefineAsDefaultForCapabilityDefinitionsSteps method I_unflag_the_node_type_as_default_for_the_capability.
@When("^I unflag the node type \"([^\"]*)\" as default for the \"([^\"]*)\" capability$")
public void I_unflag_the_node_type_as_default_for_the_capability(String componentId, String capability) throws Throwable {
RecommendationRequest recRequest = new RecommendationRequest(componentId, capability);
String jSon = jsonMapper.writeValueAsString(recRequest);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/components/unflag", jSon));
}
Aggregations