use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class SearchDefinitionSteps method I_search_for_with_query_from_with_result_size_of.
@When("^I search for \"([^\"]*)\" using query \"([^\"]*)\" from (\\d+) with result size of (\\d+)$")
public void I_search_for_with_query_from_with_result_size_of(String searchedComponentType, String query, int from, int size) throws Throwable {
ComponentSearchRequest req = new ComponentSearchRequest(QUERY_TYPES.get(searchedComponentType), query, from, size, null);
req.setType(req.getType());
String jSon = JsonUtil.toString(req);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/components/search", jSon));
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class CrudCSARSStepDefinition method I_add_a_dependency_with_name_version_to_the_CSAR_with_name_version.
@When("^I add a dependency with name \"([^\"]*)\" version \"([^\"]*)\" to the CSAR with name \"([^\"]*)\" version \"([^\"]*)\"$")
public void I_add_a_dependency_with_name_version_to_the_CSAR_with_name_version(String dependencyName, String dependencyVersion, String csarName, String csarVersion) throws Throwable {
CSARDependency dependency = new CSARDependency(dependencyName, dependencyVersion);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/csars/" + csarName + ":" + csarVersion + "-SNAPSHOT" + "/dependencies", JsonUtil.toString(dependency)));
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class CsarGitCRUDStepDefinition method i_add_a_GIT_repository_with_url_usr_pwd_stored_and_locations.
@When("^I add a GIT repository with url \"(.*?)\" usr \"(.*?)\" pwd \"(.*?)\" stored \"(.*?)\" and locations$")
public void i_add_a_GIT_repository_with_url_usr_pwd_stored_and_locations(String url, String usr, String pwd, boolean stored, List<CsarGitCheckoutLocation> locations) throws Throwable {
CreateCsarGitRequest request = new CreateCsarGitRequest();
request.setRepositoryUrl(url);
request.setUsername(usr);
request.setPassword(pwd);
request.setStoredLocally(stored);
request.setImportLocations(locations);
String response = Context.getRestClientInstance().postJSon("/rest/v1/csarsgit/", JsonUtil.toString(request));
Context.getInstance().registerRestResponse(response);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class CsarGitCRUDStepDefinition method i_update_the_GIT_repository_with_url_usr_pwd_stored_and_locations.
@When("^I update the GIT repository with url \"(.*?)\" usr \"(.*?)\" pwd \"(.*?)\" stored \"(.*?)\" and locations$")
public void i_update_the_GIT_repository_with_url_usr_pwd_stored_and_locations(String url, String usr, String pwd, boolean stored, List<CsarGitCheckoutLocation> locations) throws Throwable {
CreateCsarGitRequest request = new CreateCsarGitRequest();
request.setRepositoryUrl(url);
request.setUsername(usr);
request.setPassword(pwd);
request.setStoredLocally(stored);
request.setImportLocations(locations);
String restUrl = String.format("/rest/v1/csarsgit/%s", Context.getInstance().getCsarGitRepositoryId());
String response = Context.getRestClientInstance().putJSon(restUrl, JsonUtil.toString(request));
Context.getInstance().registerRestResponse(response);
}
use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.
the class GroupsStepDefinitions method I_create_a_new_group_with_name_in_the_system.
@When("^I create a new group with name \"([^\"]*)\" in the system$")
public void I_create_a_new_group_with_name_in_the_system(String name) throws Throwable {
CreateGroupRequest request = new CreateGroupRequest();
request.setName(name);
Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/groups/", JsonUtil.toString(request)));
}
Aggregations