use of cucumber.api.java.en.When in project apollo by spotify.
the class RequestStepdefs method sending_a_request_to.
@When("^sending a request to \"([^\"]*)\"$")
public void sending_a_request_to(String uri) throws Throwable {
Request request = Request.forUri(uri);
responseFuture = ServiceStepdefs.serviceHelper.request(request);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class EditorStepDefs method i_upload_unzipped_CSAR_From_path.
@When("^I upload unzipped CSAR from path \"(.*?)\"$")
public void i_upload_unzipped_CSAR_From_path(String path) throws Throwable {
Path source = Paths.get(path);
Path csarTargetPath = CSAR_TARGET_PATH.resolve(source.getFileName() + ".csar");
FileUtil.zip(source, csarTargetPath);
uploadCsar(csarTargetPath);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class EditorStepDefs method iResetTheTopology.
@When("^I reset the topology$")
public void iResetTheTopology() throws Throwable {
thrownException = null;
try {
TopologyDTO dto = editorService.reset(topologyIds.getLast(), topologyIdToLastOperationId.get(topologyIds.getLast()));
topologyIdToLastOperationId.put(topologyIds.getLast(), null);
dtoEvaluationContext = new StandardEvaluationContext(dto);
topologyEvaluationContext = new StandardEvaluationContext(dto.getTopology());
} catch (Exception e) {
log.error("Error occurred when resetting the topology", e);
thrownException = e;
exceptionEvaluationContext = new StandardEvaluationContext(e);
}
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_deploy_all_applications_on_the_location.
@When("^I deploy all applications on the location \"([^\"]*)\"/\"([^\"]*)\"$")
public void I_deploy_all_applications_on_the_location(String orchestratorName, String locationName) throws Throwable {
assertNotNull(ApplicationStepDefinitions.CURRENT_APPLICATIONS);
for (String key : ApplicationStepDefinitions.CURRENT_APPLICATIONS.keySet()) {
Application app = ApplicationStepDefinitions.CURRENT_APPLICATIONS.get(key);
Context.getInstance().registerApplication(app);
deploymentTopoSteps.I_Set_a_unique_location_policy_to_for_all_nodes(orchestratorName, locationName);
String appName = app.getName();
Map<String, String> environments = Context.getInstance().getAllEnvironmentForApplication(appName);
DeployApplicationRequest deployApplicationRequest = null;
for (Map.Entry<String, String> env : environments.entrySet()) {
String envName = env.getKey();
deployApplicationRequest = getDeploymentAppRequest(appName, envName);
String response = deploy(deployApplicationRequest);
Context.getInstance().registerRestResponse(response);
}
commonSteps.I_should_receive_a_RestResponse_with_no_error();
}
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_ask_for_detailed_deployments_for_orchestrator.
@When("^I ask for detailed deployments for orchestrator \"([^\"]*)\"$")
public void I_ask_for_detailed_deployments_for_orchestrator(String orchestratorName) throws Throwable {
List<NameValuePair> nvps = Lists.newArrayList();
NameValuePair nvp0 = new BasicNameValuePair("includeAppSummary", "true");
nvps.add(nvp0);
if (orchestratorName != null) {
String orchestratorId = Context.getInstance().getOrchestratorId(orchestratorName);
NameValuePair nvp1 = new BasicNameValuePair("orchestratorId", orchestratorId);
nvps.add(nvp1);
}
String response = Context.getRestClientInstance().getUrlEncoded("/rest/v1/deployments", nvps);
Context.getInstance().registerRestResponse(response);
}
Aggregations