@Test
public void duplicateAddressesAreClearedWhenUpdatingRegistrationData() throws Exception {

    final String deviceIdentification = "test-device";
    final String ipAddress = "127.0.0.1";
    final String deviceType = "DeviceType";
    final boolean hasSchedule = false;
    when(this.deviceRepository.findByDeviceIdentification(deviceIdentification))
            .thenReturn(new Device(deviceIdentification));
    this.deviceRegistrationMessageService.updateRegistrationData(deviceIdentification, ipAddress, deviceType,
            hasSchedule);
    verify(this.deviceNetworkAddressCleanupService).clearDuplicateAddresses(deviceIdentification, ipAddress);
}