use of org.openkilda.server42.control.stormstub.api.ListIslsPayload in project open-kilda by telstra.
the class StubApplicationTests method clearIsls.
@BeforeEach
public void clearIsls() throws Exception {
mockMvc.perform(delete("/kafka/isl/{switchId}", switchId)).andExpect(status().isOk());
MvcResult result = mockMvc.perform(get("/kafka/isl/{switchId}", switchId)).andReturn();
ListIslsPayload emptyPayload = new ListIslsPayload();
mockMvc.perform(asyncDispatch(result)).andExpect(status().isOk()).andExpect(content().json(objectWriter.writeValueAsString(emptyPayload)));
}
use of org.openkilda.server42.control.stormstub.api.ListIslsPayload in project open-kilda by telstra.
the class StubApplicationTests method deleteIsl.
@Test
public void deleteIsl() throws Exception {
AddIslPayload testIsl = AddIslPayload.builder().switchId(new SwitchId(switchId)).port(456).build();
pushIsl(testIsl);
mockMvc.perform(delete("/kafka/isl/{switchId}/{port}", switchId, testIsl.getPort())).andExpect(status().isOk());
MvcResult result = mockMvc.perform(get("/kafka/isl/{switchId}", switchId)).andReturn();
ListIslsPayload listIslsPayload = new ListIslsPayload();
listIslsPayload.getPorts().add(testIsl.getPort());
mockMvc.perform(asyncDispatch(result)).andExpect(status().isOk()).andExpect(content().json(objectWriter.writeValueAsString(listIslsPayload)));
}
use of org.openkilda.server42.control.stormstub.api.ListIslsPayload in project open-kilda by telstra.
the class StubApplicationTests method addIsls.
@Test
public void addIsls() throws Exception {
AddIslPayload testIsl = AddIslPayload.builder().switchId(new SwitchId(switchId)).port(456).build();
pushIsl(testIsl);
ListIslsPayload listIslsPayload = new ListIslsPayload();
listIslsPayload.getPorts().add(testIsl.getPort());
MvcResult result = mockMvc.perform(get("/kafka/isl/{switchId}", switchId)).andReturn();
mockMvc.perform(asyncDispatch(result)).andDo(print()).andExpect(status().isOk()).andExpect(content().json(objectWriter.writeValueAsString(listIslsPayload)));
}
Aggregations