use of cucumber.api.java.en.And in project open-kilda by telstra.
the class FlowCrudSteps method eachFlowIsInUPState.
@And("^each flow is in UP state$")
public void eachFlowIsInUPState() {
for (FlowPayload flow : flows) {
FlowIdStatusPayload status = Failsafe.with(retryPolicy.abortIf(p -> p != null && FlowState.UP == ((FlowIdStatusPayload) p).getStatus())).get(() -> northboundService.getFlowStatus(flow.getId()));
assertNotNull(status);
assertThat(format("The flow status for '%s' can't be retrived.", flow.getId()), status, hasProperty("id", equalTo(flow.getId())));
assertThat(format("The flow '%s' has wrong status.", flow.getId()), status, hasProperty("status", equalTo(FlowState.UP)));
}
}
use of cucumber.api.java.en.And in project open-kilda by telstra.
the class FlowCrudSteps method eachFlowIsCreatedAndStoredInTopologyEngine.
@Then("^each flow is created and stored in TopologyEngine$")
public void eachFlowIsCreatedAndStoredInTopologyEngine() {
List<Flow> expextedFlows = flows.stream().map(flow -> new Flow(flow.getId(), flow.getMaximumBandwidth(), flow.isIgnoreBandwidth(), 0, flow.getId(), null, flow.getSource().getSwitchId(), flow.getDestination().getSwitchId(), flow.getSource().getPortId(), flow.getDestination().getPortId(), flow.getSource().getVlanId(), flow.getDestination().getVlanId(), 0, 0, null, null)).collect(toList());
for (Flow expectedFlow : expextedFlows) {
ImmutablePair<Flow, Flow> flowPair = Failsafe.with(retryPolicy.abortIf(Objects::nonNull)).get(() -> topologyEngineService.getFlow(expectedFlow.getFlowId()));
assertNotNull(format("The flow '%s' is missing.", expectedFlow.getFlowId()), flowPair);
assertThat(format("The flow '%s' is different.", expectedFlow.getFlowId()), flowPair.getLeft(), is(equalTo(expectedFlow)));
}
}
use of cucumber.api.java.en.And in project open-kilda by telstra.
the class FlowCrudSteps method eachFlowCanNotBeReadFromNorthbound.
@And("^each flow can not be read from Northbound$")
public void eachFlowCanNotBeReadFromNorthbound() {
for (FlowPayload flow : flows) {
FlowPayload result = Failsafe.with(retryPolicy.abortIf(Objects::isNull)).get(() -> northboundService.getFlow(flow.getId()));
assertNull(format("The flow '%s' exists.", flow.getId()), result);
}
}
use of cucumber.api.java.en.And in project open-kilda by telstra.
the class StormTopologyLCM method allStormTopologiesInTheSameState.
/**
* We compare old inner state of cache bolt and OFELinkBolt with new state after reload
* topologies.
*/
@And("^all storm topologies in the same state$")
public void allStormTopologiesInTheSameState() throws Throwable {
DumpStateManager actualSateDumpsFromBolts = kafkaUtils.getStateDumpsFromBolts();
// CacheBolt part
Set<ImmutablePair<Flow, Flow>> actualCacheBoltFlows = actualSateDumpsFromBolts.getCacheBoltState().getFlowDump().getFlows();
Set<ImmutablePair<Flow, Flow>> expectedCacheBoltFlows = expectedStateDumpsFromBolts.getCacheBoltState().getFlowDump().getFlows();
assertTrue(CollectionUtils.isEqualCollection(actualCacheBoltFlows, expectedCacheBoltFlows));
// OFELinkBolt
OFELinkBoltState actualOfeLinkBoltState = actualSateDumpsFromBolts.getOfeLinkBoltState();
OFELinkBoltState expectedOfeLinkBoltState = expectedStateDumpsFromBolts.getOfeLinkBoltState();
assertTrue(CollectionUtils.isEqualCollection(expectedOfeLinkBoltState.getDiscovery(), actualOfeLinkBoltState.getDiscovery()));
}
use of cucumber.api.java.en.And in project syndesis-qe by syndesisio.
the class DataMapperStep method startMapperDefinition.
/**
* Just creates mapper step definition, the mapper will be generated on the integration creation.
*
* @param mapperName
*/
@And("start mapper definition with name: \"([^\"]*)\"")
public void startMapperDefinition(String mapperName) {
final Step mapperStep = new Step.Builder().stepKind(StepKind.mapper).name(mapperName).build();
steps.getStepDefinitions().add(new StepDefinition(mapperStep, new DataMapperDefinition()));
}
Aggregations