Search in sources :

Example 26 with When

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

the class ApplicationStepDefinitions method I_create_a_new_application_with_name_and_description_based_this_created_template.

@When("^I create a new application with name \"([^\"]*)\" and description \"([^\"]*)\" based on this created template$")
public void I_create_a_new_application_with_name_and_description_based_this_created_template(String name, String description) throws Throwable {
    String topologyTemplateId = TopologyTemplateStepDefinitions.CURRENT_TOPOLOGY_TEMP_ID;
    assertFalse(StringUtils.isBlank(topologyTemplateId));
    createApplication(name, appToArchName(name), description, topologyTemplateId);
}
Also used : TestUtils.nullAsString(alien4cloud.it.utils.TestUtils.nullAsString) When(cucumber.api.java.en.When)

Example 27 with When

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

the class ApplicationStepDefinitions method I_retrieve_the_newly_created_application.

@When("^I retrieve the newly created application$")
public void I_retrieve_the_newly_created_application() throws Throwable {
    // App from context
    Application contextApp = Context.getInstance().getApplication();
    Context.getInstance().registerRestResponse(getRestClientInstance().get("/rest/v1/applications/" + contextApp.getId()));
}
Also used : Application(alien4cloud.model.application.Application) When(cucumber.api.java.en.When)

Example 28 with When

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

the class ApplicationStepDefinitions method I_delete_the_application.

@When("^I delete the application \"([^\"]*)\"$")
public void I_delete_the_application(String applicationName) throws Throwable {
    String id = CURRENT_APPLICATION.getName().equals(applicationName) ? CURRENT_APPLICATION.getId() : CURRENT_APPLICATIONS.get(applicationName).getId();
    Context.getInstance().registerRestResponse(getRestClientInstance().delete("/rest/v1/applications/" + id));
}
Also used : TestUtils.nullAsString(alien4cloud.it.utils.TestUtils.nullAsString) When(cucumber.api.java.en.When)

Example 29 with When

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

the class ApplicationVersionStepDefinitions method I_search_for_application_versions.

@When("^I search for application versions$")
public void I_search_for_application_versions() throws Throwable {
    Application app = Context.getInstance().getApplication();
    FilteredSearchRequest request = new FilteredSearchRequest();
    request.setFrom(0);
    request.setSize(10);
    Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/applications/" + app.getId() + "/versions/search", JsonUtil.toString(request)));
}
Also used : FilteredSearchRequest(alien4cloud.rest.model.FilteredSearchRequest) Application(alien4cloud.model.application.Application) When(cucumber.api.java.en.When)

Example 30 with When

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

the class AuditLogStepsDefinitions method I_get_audit_log_configuration.

@When("^I get audit log configuration$")
public void I_get_audit_log_configuration() throws Throwable {
    String restResponse = Context.getRestClientInstance().get("/rest/v1/audit/configuration");
    AuditConfigurationDTO configuration = JsonUtil.read(restResponse, AuditConfigurationDTO.class).getData();
    Assert.assertNotNull(configuration);
    currentAuditConfiguration = configuration;
}
Also used : AuditConfigurationDTO(alien4cloud.audit.rest.AuditConfigurationDTO) When(cucumber.api.java.en.When)

Aggregations

When (cucumber.api.java.en.When)161 TestUtils.nullAsString (alien4cloud.it.utils.TestUtils.nullAsString)12 Application (alien4cloud.model.application.Application)10 FlowPayload (org.openkilda.messaging.payload.flow.FlowPayload)9 Response (com.jayway.restassured.response.Response)7 IOException (java.io.IOException)6 List (java.util.List)6 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)6 FilteredSearchRequest (alien4cloud.rest.model.FilteredSearchRequest)5 Then (cucumber.api.java.en.Then)5 Collectors (java.util.stream.Collectors)5 Action (org.talend.dataprep.helper.api.Action)5 ComponentSearchRequest (alien4cloud.rest.component.ComponentSearchRequest)4 TopologyDTO (alien4cloud.topology.TopologyDTO)4 Path (java.nio.file.Path)4 HashMap (java.util.HashMap)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