@Test public void noDevicesAreCleanedWhenTheNetworkAddressIsPartOfARangeAllowingDuplicates() throws Exception { final String ipAddress = "172.16.138.27"; this.withHostAndInetAddress(ipAddress); final String rangeContainingIpAddress = "172.16.130.0-172.16.139.255"; this.withConfigurationAllowingDuplicatesFor("10.1.1.111", rangeContainingIpAddress, "192.168.0.0-192.168.255.255"); this.deviceNetworkAddressCleanupService.clearDuplicateAddresses(DEVICE_IDENTIFICATION, this.host); verify(this.deviceRepository, never()).findByNetworkAddress(this.inetAddress); verify(this.deviceRepository, never()).save(any(Device.class)); }
public void clearDuplicateAddresses(final String deviceIdentification, final String host) throws UnknownHostException { this.clearDuplicateAddresses(deviceIdentification, InetAddress.getByName(host)); }
DeviceNetworkAddressCleanupService { public void clearDuplicateAddresses(final String deviceIdentification, final String host) throws UnknownHostException { this.clearDuplicateAddresses(deviceIdentification, InetAddress.getByName(host)); } }
DeviceNetworkAddressCleanupService { public void clearDuplicateAddresses(final String deviceIdentification, final String host) throws UnknownHostException { this.clearDuplicateAddresses(deviceIdentification, InetAddress.getByName(host)); } @Autowired  DeviceNetworkAddressCleanupService(final DeviceRepository deviceRepository,
            @Value("${device.network.address.cleanup.never}") final boolean allowMultipleDevicesPerNetworkAddress,
            @Value("#{'${device.network.address.cleanup.duplicates.allowed}'.split(',')}") final List<String> ipRangesAllowingMultipleDevicesPerAddress); }
DeviceNetworkAddressCleanupService { public void clearDuplicateAddresses(final String deviceIdentification, final String host) throws UnknownHostException { this.clearDuplicateAddresses(deviceIdentification, InetAddress.getByName(host)); } @Autowired  DeviceNetworkAddressCleanupService(final DeviceRepository deviceRepository,
            @Value("${device.network.address.cleanup.never}") final boolean allowMultipleDevicesPerNetworkAddress,
            @Value("#{'${device.network.address.cleanup.duplicates.allowed}'.split(',')}") final List<String> ipRangesAllowingMultipleDevicesPerAddress); static InetAddress getLocalHost(); void clearDuplicateAddresses(final String deviceIdentification, final String host); void clearDuplicateAddresses(final String deviceIdentification, final InetAddress inetAddress); boolean allowDuplicateEntries(final InetAddress inetAddress); }
DeviceNetworkAddressCleanupService { public void clearDuplicateAddresses(final String deviceIdentification, final String host) throws UnknownHostException { this.clearDuplicateAddresses(deviceIdentification, InetAddress.getByName(host)); } @Autowired  DeviceNetworkAddressCleanupService(final DeviceRepository deviceRepository,
            @Value("${device.network.address.cleanup.never}") final boolean allowMultipleDevicesPerNetworkAddress,
            @Value("#{'${device.network.address.cleanup.duplicates.allowed}'.split(',')}") final List<String> ipRangesAllowingMultipleDevicesPerAddress); static InetAddress getLocalHost(); void clearDuplicateAddresses(final String deviceIdentification, final String host); void clearDuplicateAddresses(final String deviceIdentification, final InetAddress inetAddress); boolean allowDuplicateEntries(final InetAddress inetAddress);  }