Search in sources :

Example 46 with When

use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.

the class SecretPropertiesStepDefinitions method iDefineThePropertyOfRelationshipFromTheNodeAsSecretWithASecretPathAndISaveTheTopology.

@When("^I define the property \"([^\"]*)\" of relationship \"([^\"]*)\" from the node \"([^\"]*)\" as secret with a secret path \"([^\"]*)\" and I save the topology$")
public void iDefineThePropertyOfRelationshipFromTheNodeAsSecretWithASecretPathAndISaveTheTopology(String propertyName, String relationshipName, String nodeName, String secretPath) throws Throwable {
    SetRelationshipPropertyAsSecretOperation operation = new SetRelationshipPropertyAsSecretOperation();
    operation.setNodeName(nodeName);
    operation.setRelationshipName(relationshipName);
    operation.setPropertyName(propertyName);
    operation.setSecretPath(secretPath);
    EditorStepDefinitions.do_i_execute_the_operation(operation);
    EditorStepDefinitions.do_i_save_the_topology();
}
Also used : SetRelationshipPropertyAsSecretOperation(org.alien4cloud.tosca.editor.operations.secrets.SetRelationshipPropertyAsSecretOperation) When(cucumber.api.java.en.When)

Example 47 with When

use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.

the class SearchDefinitionSteps method I_search_for_from_with_result_size_of.

@When("^I search for \"([^\"]*)\" from (\\d+) with result size of (\\d+)$")
public void I_search_for_from_with_result_size_of(String searchedComponentType, int from, int size) throws Throwable {
    ComponentSearchRequest req = new ComponentSearchRequest(QUERY_TYPES.get(searchedComponentType), null, from, size, null);
    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 48 with When

use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.

the class SearchDefinitionSteps method I_search_for_from_with_result_size_of_and_filter_set_to.

@When("^I search for \"([^\"]*)\" from (\\d+) with result size of (\\d+) and filter \"([^\"]*)\" set to \"([^\"]*)\"$")
public void I_search_for_from_with_result_size_of_and_filter_set_to(String searchedComponentType, int from, int size, String filterName, String filterValue) throws Throwable {
    Map<String, String[]> filters = Maps.newHashMap();
    filters.put(filterName, new String[] { filterValue });
    ComponentSearchRequest req = new ComponentSearchRequest(QUERY_TYPES.get(searchedComponentType), null, from, size, filters);
    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 49 with When

use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.

the class SearchDefinitionSteps method I_make_a_basic_search_for_from_with_result_size_of.

@When("^I make a basic \"([^\"]*)\" search for \"([^\"]*)\" from (\\d+) with result size of (\\d+)$")
public void I_make_a_basic_search_for_from_with_result_size_of(String query, String searchedComponentType, int from, int size) throws Throwable {
    // BasicSearchRequest req = new BasicSearchRequest(query, from, size);
    ComponentSearchRequest req = new ComponentSearchRequest(QUERY_TYPES.get(searchedComponentType), query, from, size, null);
    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 50 with When

use of cucumber.api.java.en.When in project alien4cloud by alien4cloud.

the class UpdateDeleteTagDefinitionsSteps method I_update_a_tag_with_key_and_value.

@When("^I update a tag with key \"([^\"]*)\" and value \"([^\"]*)\"$")
public void I_update_a_tag_with_key_and_value(String tagKey, String tagValue) throws Throwable {
    UpdateTagRequest updateTagRequest = new UpdateTagRequest();
    updateTagRequest.setTagKey(tagKey);
    updateTagRequest.setTagValue(tagValue);
    Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/components/" + Context.getInstance().getComponentId(0) + "/tags", jsonMapper.writeValueAsString(updateTagRequest)));
}
Also used : UpdateTagRequest(alien4cloud.rest.component.UpdateTagRequest) 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