Bug 8153: enforce check-style rules for netconf
[netconf.git] / netconf / callhome-provider / src / test / java / org / opendaylight / netconf / callhome / mount / ContextKeyTest.java
index c3a5da5fc098b2c4afeffa30c1f2a979cb970a97..cdb0462d8f95ef0a0acd704ba87d12ac680acb75 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.netconf.callhome.mount;
 
-
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
@@ -16,11 +15,10 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import com.google.common.net.InetAddresses;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
-import java.net.InetAddress;
 import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.netconf.client.NetconfClientSession;
@@ -30,7 +28,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
 
-
 public class ContextKeyTest {
     private IpAddress address1;
     private IpAddress address2;
@@ -89,10 +86,10 @@ public class ContextKeyTest {
     }
 
     @Test
-    public void newContextCanBeCreatedFromASocketAddress() throws UnknownHostException {
+    public void newContextCanBeCreatedFromASocketAddress() {
         // given
-        Inet4Address someAddressIpv4 = (Inet4Address) InetAddress.getByName("1.2.3.4");
-        Inet6Address someAddressIpv6 = (Inet6Address) InetAddress.getByName("::1");
+        Inet4Address someAddressIpv4 = (Inet4Address) InetAddresses.forString("1.2.3.4");
+        Inet6Address someAddressIpv6 = (Inet6Address) InetAddresses.forString("::1");
         // and
         ContextKey key1 = ContextKey.from(new InetSocketAddress(someAddressIpv4, 123));
         ContextKey key2 = ContextKey.from(new InetSocketAddress(someAddressIpv6, 123));