Search in sources :

Example 6 with Context

use of alien4cloud.it.Context in project alien4cloud by alien4cloud.

the class DeploymentTopologyStepDefinitions method doSubstitution.

public void doSubstitution(String templateName, String resourceId, String restUrlFormat) throws IOException {
    Context context = Context.getInstance();
    Application application = context.getApplication();
    String envId = context.getDefaultApplicationEnvironmentId(application.getName());
    String restUrl = String.format(restUrlFormat, application.getId(), envId, templateName);
    NameValuePair resourceParam = new BasicNameValuePair("locationResourceTemplateId", resourceId);
    String response = Context.getRestClientInstance().postUrlEncoded(restUrl, Lists.newArrayList(resourceParam));
    context.registerRestResponse(response);
}
Also used : EvaluationContext(org.springframework.expression.EvaluationContext) Context(alien4cloud.it.Context) StandardEvaluationContext(org.springframework.expression.spel.support.StandardEvaluationContext) NameValuePair(org.apache.http.NameValuePair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) Application(alien4cloud.model.application.Application)

Aggregations

Context (alien4cloud.it.Context)6 EvaluationContext (org.springframework.expression.EvaluationContext)6 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)6 Application (alien4cloud.model.application.Application)3 When (cucumber.api.java.en.When)3 UpdatePropertyRequest (alien4cloud.rest.topology.UpdatePropertyRequest)2 DeploymentTopologyDTO (alien4cloud.deployment.DeploymentTopologyDTO)1 Then (cucumber.api.java.en.Then)1 NameValuePair (org.apache.http.NameValuePair)1 BasicNameValuePair (org.apache.http.message.BasicNameValuePair)1