use of org.openkilda.model.LinkParametersDto in project open-kilda by telstra.
the class SwitchControllerTest method testDeleteIsl.
@Test
public void testDeleteIsl() throws Exception {
LinkParametersDto linkParametersDto = new LinkParametersDto();
linkParametersDto.setSrcPort(Integer.valueOf(TestIslMock.SRC_PORT));
linkParametersDto.setSrcSwitch(TestIslMock.SRC_SWITCH);
linkParametersDto.setDstPort(Integer.valueOf(TestIslMock.DST_PORT));
linkParametersDto.setDstSwitch(TestIslMock.DST_SWITCH);
List<IslLinkInfo> islLinkInfo = new ArrayList<IslLinkInfo>();
String inputJson = mapToJson(linkParametersDto);
when(serviceSwitch.deleteLink(linkParametersDto, TestIslMock.USER_ID)).thenReturn(islLinkInfo);
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.delete("/api/switch/links").content(inputJson).contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)).andReturn();
int status = mvcResult.getResponse().getStatus();
assertEquals(200, status);
}
use of org.openkilda.model.LinkParametersDto in project open-kilda by telstra.
the class SwitchControllerTest method testUpdateIslBfdFlag.
@Test
public void testUpdateIslBfdFlag() throws Exception {
LinkParametersDto linkParametersDto = new LinkParametersDto();
linkParametersDto.setSrcPort(Integer.valueOf(TestIslMock.SRC_PORT));
linkParametersDto.setSrcSwitch(TestIslMock.SRC_SWITCH);
linkParametersDto.setDstPort(Integer.valueOf(TestIslMock.DST_PORT));
linkParametersDto.setDstSwitch(TestIslMock.DST_SWITCH);
linkParametersDto.setEnableBfd(TestIslMock.ENABLE_BFD_FLAG);
String inputJson = mapToJson(linkParametersDto);
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.patch("/api/switch/link/enable-bfd").content(inputJson).contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)).andReturn();
int status = mvcResult.getResponse().getStatus();
assertEquals(200, status);
}
Aggregations