use of org.openkilda.server42.control.stormstub.api.ListFlowsPayload in project open-kilda by telstra.
the class StubApplicationTests method clearFlows.
@BeforeEach
public void clearFlows() throws Exception {
mockMvc.perform(delete("/kafka/flow/").param("switchId", switchId)).andExpect(status().isOk());
MvcResult result = mockMvc.perform(get("/kafka/flow/").param("switchId", switchId)).andReturn();
ListFlowsPayload emptyPayload = new ListFlowsPayload();
mockMvc.perform(asyncDispatch(result)).andExpect(status().isOk()).andExpect(content().json(objectWriter.writeValueAsString(emptyPayload)));
}
use of org.openkilda.server42.control.stormstub.api.ListFlowsPayload in project open-kilda by telstra.
the class StubApplicationTests method deleteFlow.
@Test
public void deleteFlow() throws Exception {
pushFlow(testFlowVlan1001);
pushFlow(testFlowVxlan2002);
pushFlow(testFlowVxlan3003);
mockMvc.perform(delete("/kafka/flow/{id}", testFlowVxlan2002.getFlowId()).param("switchId", switchId)).andExpect(status().isOk());
MvcResult result = mockMvc.perform(get("/kafka/flow/").param("switchId", switchId)).andReturn();
ListFlowsPayload listFlowsPayload = new ListFlowsPayload();
listFlowsPayload.getFlowIds().add(testFlowVlan1001.getFlowId());
listFlowsPayload.getFlowIds().add(testFlowVxlan3003.getFlowId());
mockMvc.perform(asyncDispatch(result)).andExpect(status().isOk()).andExpect(content().json(objectWriter.writeValueAsString(listFlowsPayload)));
}
use of org.openkilda.server42.control.stormstub.api.ListFlowsPayload in project open-kilda by telstra.
the class StubApplicationTests method addFlows.
@Test
public void addFlows() throws Exception {
pushFlow(testFlowVlan1001);
pushFlow(testFlowVxlan2002);
ListFlowsPayload listFlowsPayload = new ListFlowsPayload();
listFlowsPayload.getFlowIds().add(testFlowVlan1001.getFlowId());
listFlowsPayload.getFlowIds().add(testFlowVxlan2002.getFlowId());
MvcResult result = mockMvc.perform(get("/kafka/flow/").param("switchId", switchId)).andReturn();
mockMvc.perform(asyncDispatch(result)).andDo(print()).andExpect(status().isOk()).andExpect(content().json(objectWriter.writeValueAsString(listFlowsPayload)));
}
Aggregations