Search in sources :

Example 1 with When

use of cucumber.api.java.en.When in project open-kilda by telstra.

the class FlowCrudSteps method creationRequestForEachFlowIsSuccessful.

@When("^creation request for each flow is successful$")
public void creationRequestForEachFlowIsSuccessful() {
    for (FlowPayload flow : flows) {
        FlowPayload result = northboundService.addFlow(flow);
        assertThat(result, reflectEquals(flow, "lastUpdated"));
        assertThat(result, hasProperty("lastUpdated", notNullValue()));
    }
}
Also used : FlowPayload(org.openkilda.messaging.payload.flow.FlowPayload) When(cucumber.api.java.en.When)

Example 2 with When

use of cucumber.api.java.en.When in project open-kilda by telstra.

the class FlowFFRTest method flowPathIsAlternate.

@When("^flow (.+) path is alternate$")
public void flowPathIsAlternate(String flowId) throws Throwable {
    String flowName = FlowUtils.getFlowName(flowId);
    FlowPathPayload payload = getFlowPath(flowName, FlowPathTest.expectedAlternatePath.getLeft());
    assertNotNull(payload);
    assertEquals(flowName, payload.getId());
    assertEquals(FlowPathTest.expectedAlternatePath.getLeft(), payload.getPath());
}
Also used : FlowPathPayload(org.openkilda.messaging.payload.flow.FlowPathPayload) When(cucumber.api.java.en.When)

Example 3 with When

use of cucumber.api.java.en.When in project open-kilda by telstra.

the class FlowIgnoreBandwidthTest method dropCreatedEarlyFlow.

@When("^drop created flow between ([0-9a-f]{2}(?::[0-9a-f]{2}){7}) and ([0-9a-f]{2}(?::[0-9a-f]{2}){7})$")
public void dropCreatedEarlyFlow(String source, String dest) throws FlowOperationException, InterruptedException {
    String flowId = lookupCreatedFlowId(source, dest);
    System.out.println(String.format("==> Send flow DELETE request (%s <--> %s)", source, dest));
    FlowPayload response = FlowUtils.deleteFlow(flowId);
    assertNotNull(response);
    System.out.println(String.format("==> Wait till flow become \"DOWN\" (%s <--> %s)", source, dest));
    FlowUtils.waitFlowDeletion(flowId);
}
Also used : FlowPayload(org.openkilda.messaging.payload.flow.FlowPayload) When(cucumber.api.java.en.When)

Example 4 with When

use of cucumber.api.java.en.When in project open-kilda by telstra.

the class FlowIgnoreBandwidthTest method flowIgnoreBandwidthBetweenSwitchesWithBandwidthIsCreated.

@When("^flow ignore bandwidth between ([0-9a-f]{2}(?::[0-9a-f]{2}){7}) and ([0-9a-f]{2}(?::[0-9a-f]{2}){7}) with (\\d+) bandwidth is created$")
public void flowIgnoreBandwidthBetweenSwitchesWithBandwidthIsCreated(String source, String dest, int bandwidth) throws InterruptedException {
    String flowId = FlowUtils.getFlowName("flowId");
    FlowEndpointPayload sourcePoint = new FlowEndpointPayload(source, 1, 0);
    FlowEndpointPayload destPoint = new FlowEndpointPayload(dest, 2, 0);
    FlowPayload requestPayload = new FlowPayload(flowId, sourcePoint, destPoint, bandwidth, true, "Flow that ignore ISL bandwidth", null);
    System.out.println(String.format("==> Send flow CREATE request (%s <--> %s)", source, dest));
    FlowPayload response = FlowUtils.putFlow(requestPayload);
    Assert.assertNotNull(response);
    response.setLastUpdated(null);
    System.out.println(String.format("==> Wait till flow become \"UP\" (%s <--> %s)", source, dest));
    FlowIdStatusPayload status = FlowUtils.waitFlowStatus(flowId, FlowState.UP);
    assertNotNull(status);
    assertEquals(FlowState.UP, status.getStatus());
    saveCreatedFlowId(source, dest, flowId);
}
Also used : FlowPayload(org.openkilda.messaging.payload.flow.FlowPayload) FlowIdStatusPayload(org.openkilda.messaging.payload.flow.FlowIdStatusPayload) FlowEndpointPayload(org.openkilda.messaging.payload.flow.FlowEndpointPayload) When(cucumber.api.java.en.When)

Example 5 with When

use of cucumber.api.java.en.When in project open-kilda by telstra.

the class FlowReinstallTest method flowRerouteFeatureStatus.

@When("flow reroute feature is (on|off)$")
public void flowRerouteFeatureStatus(final String statusString) {
    boolean status = statusString.equals("on");
    FeatureTogglePayload desired = new FeatureTogglePayload(null, status);
    FeatureTogglePayload result = FlowUtils.updateFeaturesStatus(desired);
    assertNotNull(result);
    assertEquals(status, result.getReflowOnSwitchActivationEnabled());
    assertEquals(desired.getReflowOnSwitchActivationEnabled(), result.getReflowOnSwitchActivationEnabled());
}
Also used : FeatureTogglePayload(org.openkilda.messaging.payload.FeatureTogglePayload) When(cucumber.api.java.en.When)

Aggregations

When (cucumber.api.java.en.When)153 TestUtils.nullAsString (alien4cloud.it.utils.TestUtils.nullAsString)12 Application (alien4cloud.model.application.Application)10 FlowPayload (org.openkilda.messaging.payload.flow.FlowPayload)9 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