use of org.openkilda.messaging.model.SwitchLocation in project open-kilda by telstra.
the class SwitchOperationsServiceTest method shouldPatchSwitch.
@Test
public void shouldPatchSwitch() throws SwitchNotFoundException {
Switch sw = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build();
switchRepository.add(sw);
SwitchPatch switchPatch = new SwitchPatch("pop", new SwitchLocation(48.860611, 2.337633, "street", "city", "country"));
switchOperationsService.patchSwitch(TEST_SWITCH_ID, switchPatch);
Switch updatedSwitch = switchRepository.findById(TEST_SWITCH_ID).get();
assertEquals(switchPatch.getPop(), updatedSwitch.getPop());
assertEquals(switchPatch.getLocation().getLatitude(), updatedSwitch.getLatitude());
assertEquals(switchPatch.getLocation().getLongitude(), updatedSwitch.getLongitude());
assertEquals(switchPatch.getLocation().getStreet(), updatedSwitch.getStreet());
assertEquals(switchPatch.getLocation().getCity(), updatedSwitch.getCity());
assertEquals(switchPatch.getLocation().getCountry(), updatedSwitch.getCountry());
}
Aggregations