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()));
}
}
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());
}
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);
}
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);
}
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());
}
Aggregations