Remove use of junit-addons
[lispflowmapping.git] / mappingservice / lisp-proto / src / test / java / org / opendaylight / lispflowmapping / serializer / address / ExplicitLocatorPathSerializerTest.java
index 20bf562bebd76f705da49518f33ca67cb0b66446..0727c41e9a4b2fd80684fb386718fcee459cc932 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.lispflowmapping.serializer.address;
 
+import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
-import junitx.framework.ArrayAssert;
 import org.junit.Test;
 import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
 import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
@@ -35,7 +35,7 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
                 + "00 00 00 01 AA BB CC DD "   // IPv4
                 + "00 00 00 01 11 22 33 44")); // IPv4
 
-        assertEquals(ExplicitLocatorPathLcaf.class, address.getAddressType());
+        assertEquals(ExplicitLocatorPathLcaf.VALUE, address.getAddressType());
         ExplicitLocatorPath elp = (ExplicitLocatorPath) address.getAddress();
 
         List<Hop> hops = elp.getExplicitLocatorPath().getHop();
@@ -52,7 +52,7 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
                 + "00 05 00 01 AA BB CC DD "   // IPv4
                 + "00 02 00 01 11 22 33 44")); // IPv4
 
-        assertEquals(ExplicitLocatorPathLcaf.class, address.getAddressType());
+        assertEquals(ExplicitLocatorPathLcaf.VALUE, address.getAddressType());
         ExplicitLocatorPath elp = (ExplicitLocatorPath) address.getAddress();
 
         List<Hop> hops = elp.getExplicitLocatorPath().getHop();
@@ -73,7 +73,7 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
         Rloc address = LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer("40 03 00 00 "
                 + "0A 00 00 00 "));
 
-        assertEquals(ExplicitLocatorPathLcaf.class, address.getAddressType());
+        assertEquals(ExplicitLocatorPathLcaf.VALUE, address.getAddressType());
         ExplicitLocatorPath elp = (ExplicitLocatorPath) address.getAddress();
 
         List<Hop> hops = elp.getExplicitLocatorPath().getHop();
@@ -82,10 +82,11 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
 
     @Test(expected = LispSerializationException.class)
     public void deserialize__ShorterBuffer() throws Exception {
-        LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer("40 03 00 00 "
-                + "0A 00 00 18 "
-                + "00 01 AA BB CC DD " // IPv4
-                + "00 02 11 22 33 44 11 22 33 44 11 22 33 44"));
+        LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer("""
+            40 03 00 00 \
+            0A 00 00 18 \
+            00 01 AA BB CC DD \
+            00 02 11 22 33 44 11 22 33 44 11 22 33 44"""));
     }
 
     @Test(expected = LispSerializationException.class)
@@ -106,7 +107,7 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
         elpb.setHop(hops);
 
         RlocBuilder rb = new RlocBuilder();
-        rb.setAddressType(ExplicitLocatorPathLcaf.class);
+        rb.setAddressType(ExplicitLocatorPathLcaf.VALUE);
         rb.setVirtualNetworkId(null);
         rb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
             .lisp.address.address.ExplicitLocatorPathBuilder()
@@ -118,13 +119,13 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
                 + "0A 00 00 10 "
                 + "00 00 00 01 AA BB CC DD "  // IPv4
                 + "00 00 00 01 11 22 33 44"); // IPv4
-        ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+        assertArrayEquals(expectedBuf.array(), buf.array());
     }
 
     @Test
     public void serialize__NoAddresses() throws Exception {
         RlocBuilder rb = new RlocBuilder();
-        rb.setAddressType(ExplicitLocatorPathLcaf.class);
+        rb.setAddressType(ExplicitLocatorPathLcaf.VALUE);
         rb.setVirtualNetworkId(null);
         rb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
             .lisp.address.address.ExplicitLocatorPathBuilder().build());
@@ -133,6 +134,6 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
         LispAddressSerializer.getInstance().serialize(buf, rb.build());
         ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 "
                 + "0A 00 00 00");
-        ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+        assertArrayEquals(expectedBuf.array(), buf.array());
     }
 }