Search in sources :

Example 1 with LagPortDto

use of org.openkilda.messaging.nbtopology.response.LagPortDto in project open-kilda by telstra.

the class LagPortMapperTest method mapLagPortToDtoTest.

@Test
public void mapLagPortToDtoTest() {
    LagLogicalPort lagLogicalPort = new LagLogicalPort(SWITCH_ID, LAG_PORT, Lists.newArrayList(PHYSICAL_PORT_1, PHYSICAL_PORT_2));
    LagPortDto dto = LagPortMapper.INSTANCE.map(lagLogicalPort);
    assertEquals(LAG_PORT, dto.getLogicalPortNumber());
    assertEquals(PHYSICAL_PORT_1, dto.getPortNumbers().get(0).intValue());
    assertEquals(PHYSICAL_PORT_2, dto.getPortNumbers().get(1).intValue());
}
Also used : LagPortDto(org.openkilda.messaging.nbtopology.response.LagPortDto) LagLogicalPort(org.openkilda.model.LagLogicalPort) Test(org.junit.Test)

Example 2 with LagPortDto

use of org.openkilda.messaging.nbtopology.response.LagPortDto in project open-kilda by telstra.

the class LagPortMapperTest method mapLagPortDtoTest.

@Test
public void mapLagPortDtoTest() {
    LagPortDto response = new LagPortDto(LOGICAL_PORT_NUMBER_1, Lists.newArrayList(PHYSICAL_PORT_NUMBER_1, PHYSICAL_PORT_NUMBER_2));
    org.openkilda.northbound.dto.v2.switches.LagPortDto dto = lagMapper.map(response);
    assertEquals(LOGICAL_PORT_NUMBER_1, dto.getLogicalPortNumber());
    assertEquals(PHYSICAL_PORT_NUMBER_1, dto.getPortNumbers().get(0).intValue());
    assertEquals(PHYSICAL_PORT_NUMBER_2, dto.getPortNumbers().get(1).intValue());
}
Also used : LagPortDto(org.openkilda.messaging.nbtopology.response.LagPortDto) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 LagPortDto (org.openkilda.messaging.nbtopology.response.LagPortDto)2 LagLogicalPort (org.openkilda.model.LagLogicalPort)1