use of org.openkilda.messaging.nbtopology.response.LinkPropsData in project open-kilda by telstra.
the class LinkServiceTest method shouldGetPropsList.
@Test
public void shouldGetPropsList() {
final String correlationId = "non-empty-link-props";
org.openkilda.messaging.model.LinkPropsDto linkProps = new org.openkilda.messaging.model.LinkPropsDto(new NetworkEndpoint(new SwitchId("00:00:00:00:00:00:00:01"), 1), new NetworkEndpoint(new SwitchId("00:00:00:00:00:00:00:02"), 2), Collections.singletonMap("cost", "2"));
LinkPropsData linkPropsData = new LinkPropsData(linkProps);
messageExchanger.mockChunkedResponse(correlationId, Collections.singletonList(linkPropsData));
RequestCorrelationId.create(correlationId);
List<LinkPropsDto> result = linkService.getLinkProps(null, 0, null, 0).join();
assertFalse("List of link props shouldn't be empty", result.isEmpty());
LinkPropsDto dto = result.get(0);
assertThat(dto.getSrcSwitch(), is(linkPropsData.getLinkProps().getSource().getDatapath().toString()));
assertThat(dto.getSrcPort(), is(linkPropsData.getLinkProps().getSource().getPortNumber()));
assertThat(dto.getDstSwitch(), is(linkPropsData.getLinkProps().getDest().getDatapath().toString()));
assertThat(dto.getDstPort(), is(linkPropsData.getLinkProps().getDest().getPortNumber()));
}
Aggregations