Skip to content

Commit

Permalink
add new helper: getFlowHistoryByAction
Browse files Browse the repository at this point in the history
  • Loading branch information
andriidovhan committed Sep 12, 2019
1 parent a76c61a commit 2c8e0c1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Expand Up @@ -11,6 +11,7 @@ import org.openkilda.messaging.payload.flow.FlowCreatePayload
import org.openkilda.messaging.payload.flow.FlowEndpointPayload
import org.openkilda.messaging.payload.flow.FlowPayload
import org.openkilda.messaging.payload.flow.FlowState
import org.openkilda.messaging.payload.history.FlowEventPayload
import org.openkilda.model.Flow
import org.openkilda.northbound.dto.v2.flows.FlowEndpointV2
import org.openkilda.testing.model.topology.TopologyDefinition
Expand Down Expand Up @@ -261,6 +262,14 @@ class FlowHelper {
}
}

List<FlowEventPayload> getFlowHistoryByAction(String flowId, String action) {
getFlowHistoryByAction(flowId, null, null, action)
}

List<FlowEventPayload> getFlowHistoryByAction(String flowId, Long timeFrom, Long timeTo, String action) {
northbound.getFlowHistory(flowId, timeFrom, timeTo).findAll { it.action == action }
}

/**
* Returns flow endpoint with randomly chosen vlan.
*
Expand Down
@@ -0,0 +1,29 @@
package org.openkilda.functionaltests.helpers

enum FlowHistoryAction {
FlowCreating {
String toString() {
return "Flow creating"
}
},
FlowUpdating {
String toString() {
return "Flow creating"
}
},
FlowRerouting {
String toString() {
return "Flow rerouting"
}
},
SetTheFlowStatusToDown {
String toString() {
return "Set the flow status to down."
}
},
FlowWasValidatedSuccessfully {
String toString() {
return "Flow was validated successfully"
}
},
}

0 comments on commit 2c8e0c1

Please sign in to comment.