use of org.openkilda.northbound.dto.v2.switches.SwitchDtoV2 in project open-kilda by telstra.
the class SwitchMapperTest method testSwitchToSwitchDtoV2.
@Test
public void testSwitchToSwitchDtoV2() {
Switch sw = getSwitch();
SwitchDtoV2 switchDto = switchMapper.map(sw);
assertEquals(sw.getSwitchId(), switchDto.getSwitchId());
assertEquals("127.0.0.1", switchDto.getAddress());
assertEquals(sw.getSocketAddress().getPort(), switchDto.getPort());
assertEquals(sw.getHostname(), switchDto.getHostname());
assertEquals(sw.getDescription(), switchDto.getDescription());
assertEquals(switchMapper.convertStatus(sw.getStatus()), switchDto.getState());
assertEquals(sw.isUnderMaintenance(), switchDto.isUnderMaintenance());
assertEquals(sw.getOfVersion(), switchDto.getOfVersion());
assertEquals(sw.getOfDescriptionManufacturer(), switchDto.getManufacturer());
assertEquals(sw.getOfDescriptionHardware(), switchDto.getHardware());
assertEquals(sw.getOfDescriptionSoftware(), switchDto.getSoftware());
assertEquals(sw.getOfDescriptionSerialNumber(), switchDto.getSerialNumber());
assertEquals(sw.getPop(), switchDto.getPop());
assertEquals((Double) sw.getLatitude(), switchDto.getLocation().getLatitude());
assertEquals((Double) sw.getLongitude(), switchDto.getLocation().getLongitude());
assertEquals(sw.getStreet(), switchDto.getLocation().getStreet());
assertEquals(sw.getCity(), switchDto.getLocation().getCity());
assertEquals(sw.getCountry(), switchDto.getLocation().getCountry());
}
Aggregations