Remove use of junit-addons
[lispflowmapping.git] / mappingservice / lisp-proto / src / test / java / org / opendaylight / lispflowmapping / serializer / address / SourceDestKeySerializerTest.java
index 79b7b14cb076d5c80c1e2b7c88ed66aeb12cee50..7564dab457873cbdbfaa995af701970c53f3d3ac 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.lispflowmapping.serializer.address;
 
+import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
 import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
 import org.junit.Test;
 import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
 import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializerContext;
@@ -30,14 +30,14 @@ public class SourceDestKeySerializerTest extends BaseTestCase {
 
     @Test
     public void deserialize__Simple() throws Exception {
-        Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "0C 20 00 10 " + //
-                "00 00 10 18 " + // reserved + masks
-                "00 01 11 22 33 44 " + // AFI=1, IP=0x11223344
-                "00 01 22 33 44 55"),  // AFI=1, IP=0x22334455
+        Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 "
+                + "0C 20 00 10 "
+                + "00 00 10 18 " // reserved + masks
+                + "00 01 11 22 33 44 "  // AFI=1, IP=0x11223344
+                + "00 01 22 33 44 55"), // AFI=1, IP=0x22334455
                 new LispAddressSerializerContext(null));
 
-        assertEquals(SourceDestKeyLcaf.class, address.getAddressType());
+        assertEquals(SourceDestKeyLcaf.VALUE, address.getAddressType());
         SourceDestKey srcDestAddress = (SourceDestKey) address.getAddress();
 
         assertEquals((byte) 0x10, MaskUtil.getMaskForAddress(srcDestAddress.getSourceDestKey().getSource()));
@@ -49,28 +49,31 @@ public class SourceDestKeySerializerTest extends BaseTestCase {
 
     @Test(expected = LispSerializationException.class)
     public void deserialize__ShorterBuffer() throws Exception {
-        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "02 20 00 0A " + //
-                "AA BB "), new LispAddressSerializerContext(null));
+        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("""
+            40 03 00 00 \
+            02 20 00 0A \
+            AA BB \
+            """), new LispAddressSerializerContext(null));
     }
 
     @Test(expected = LispSerializationException.class)
     public void deserialize__UnknownLCAFType() throws Exception {
-        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "AA 20 00 0A " + // Type AA is unknown
-                "00 00 CC DD " + // reserved + masks
-                "00 01 11 22 33 44 " + // AFI=1, IP=0x11223344
-                "00 01 22 33 44 55"),  // AFI=1, IP=0x22334455
+        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("""
+            40 03 00 00 \
+            AA 20 00 0A \
+            00 00 CC DD \
+            00 01 11 22 33 44 \
+            00 01 22 33 44 55"""), // AFI=1, IP=0x22334455
                 new LispAddressSerializerContext(null));
     }
 
     @Test
     public void deserialize__Ipv6() throws Exception {
-        Eid srcAddress = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "0C 20 00 28 " + //
-                "00 00 78 78 " + // reserved + masks
-                "00 02 11 22 33 44 55 66 77 88 99 AA BB CC AA BB CC DD " + // AFI=2,
-                "00 02 44 33 22 11 88 77 66 55 99 AA BB CC AA BB CC DD"),  // AFI=2,
+        Eid srcAddress = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 "
+                + "0C 20 00 28 "
+                + "00 00 78 78 " // reserved + masks
+                + "00 02 11 22 33 44 55 66 77 88 99 AA BB CC AA BB CC DD "  // AFI=2,
+                + "00 02 44 33 22 11 88 77 66 55 99 AA BB CC AA BB CC DD"), // AFI=2,
                 new LispAddressSerializerContext(null));
         // IPv6
 
@@ -87,7 +90,7 @@ public class SourceDestKeySerializerTest extends BaseTestCase {
         addressBuilder.setDest(new SimpleAddress(new IpPrefix(new Ipv4Prefix("34.51.68.85/16"))));
 
         EidBuilder eb = new EidBuilder();
-        eb.setAddressType(SourceDestKeyLcaf.class);
+        eb.setAddressType(SourceDestKeyLcaf.VALUE);
         eb.setVirtualNetworkId(null);
         eb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
             .lisp.address.address.SourceDestKeyBuilder()
@@ -96,11 +99,11 @@ public class SourceDestKeySerializerTest extends BaseTestCase {
         ByteBuffer buf = ByteBuffer.allocate(LispAddressSerializer.getInstance().getAddressSize(eb.build()));
         LispAddressSerializer.getInstance().serialize(buf, eb.build());
 
-        ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 " + //
-                "0C 00 00 10 " + //
-                "00 00 08 10 " + // reserved + masks
-                "00 01 11 22 33 44 " + // AFI=1, IP=0x11223344
-                "00 01 22 33 44 55"); // AFI=1, IP=0x22334455
-        ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+        ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 "
+                + "0C 00 00 10 " //
+                + "00 00 08 10 " // reserved + masks
+                + "00 01 11 22 33 44 "  // AFI=1, IP=0x11223344
+                "00 01 22 33 44 55"); // AFI=1, IP=0x22334455
+        assertArrayEquals(expectedBuf.array(), buf.array());
     }
 }