Search in sources :

Example 91 with When

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));
}
Also used : ComponentSearchRequest(alien4cloud.rest.component.ComponentSearchRequest) When(cucumber.api.java.en.When)

Example 92 with When

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)));
}
Also used : CSARDependency(org.alien4cloud.tosca.model.CSARDependency) When(cucumber.api.java.en.When)

Example 93 with When

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);
}
Also used : CreateCsarGitRequest(alien4cloud.rest.csar.CreateCsarGitRequest) When(cucumber.api.java.en.When)

Example 94 with When

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);
}
Also used : CreateCsarGitRequest(alien4cloud.rest.csar.CreateCsarGitRequest) When(cucumber.api.java.en.When)

Example 95 with When

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)));
}
Also used : CreateGroupRequest(alien4cloud.security.groups.rest.CreateGroupRequest) When(cucumber.api.java.en.When)

Aggregations

When (cucumber.api.java.en.When)148 TestUtils.nullAsString (alien4cloud.it.utils.TestUtils.nullAsString)12 Application (alien4cloud.model.application.Application)10 FlowPayload (org.openkilda.messaging.payload.flow.FlowPayload)6 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)6 ComponentSearchRequest (alien4cloud.rest.component.ComponentSearchRequest)5 FilteredSearchRequest (alien4cloud.rest.model.FilteredSearchRequest)5 TopologyDTO (alien4cloud.topology.TopologyDTO)4 Path (java.nio.file.Path)4 List (java.util.List)4 UiApplicationDriver (org.activityinfo.test.driver.UiApplicationDriver)4 PivotTableEditor (org.activityinfo.test.pageobject.web.reports.PivotTableEditor)4 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)4 WebElement (org.openqa.selenium.WebElement)4 MvcResult (org.springframework.test.web.servlet.MvcResult)4 NotFoundException (alien4cloud.exception.NotFoundException)3 Context (alien4cloud.it.Context)3 MetaPropConfiguration (alien4cloud.model.common.MetaPropConfiguration)3 DeployApplicationRequest (alien4cloud.rest.application.model.DeployApplicationRequest)3 UpdateDeploymentTopologyRequest (alien4cloud.rest.application.model.UpdateDeploymentTopologyRequest)3