Remove use of junit-addons
[lispflowmapping.git] / mappingservice / lisp-proto / src / test / java / org / opendaylight / lispflowmapping / serializer / address / DistinguishedNameSerializerTest.java
index f2cedfdc8f8cffcfc9c25375e950fb3ae94c0ff1..d8bb2dec72c67e32f12aa64101b5aec181e52f2d 100644 (file)
@@ -7,12 +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.exception.LispSerializationException;
@@ -32,11 +30,10 @@ public class DistinguishedNameSerializerTest extends BaseTestCase {
     public void deserialize__EmptyString() throws Exception {
         Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("00 11 00"), null);
 
-        assertEquals(DistinguishedNameAfi.class, address.getAddressType());
+        assertEquals(DistinguishedNameAfi.VALUE, address.getAddressType());
         DistinguishedName distinguishedName = (DistinguishedName) address.getAddress();
 
         assertEquals("", distinguishedName.getDistinguishedName().getValue());
-
     }
 
     @Test
@@ -44,7 +41,7 @@ public class DistinguishedNameSerializerTest extends BaseTestCase {
         Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("00 11 64 61 76 69 64 00"),
                 null);
 
-        assertEquals(DistinguishedNameAfi.class, address.getAddressType());
+        assertEquals(DistinguishedNameAfi.VALUE, address.getAddressType());
         DistinguishedName distinguishedName = (DistinguishedName) address.getAddress();
 
         assertEquals("david", distinguishedName.getDistinguishedName().getValue());
@@ -53,27 +50,28 @@ public class DistinguishedNameSerializerTest extends BaseTestCase {
 
     @Test
     public void deserialize__inList() throws Exception {
-        Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "01 00 00 8 " + //
-                "00 11 64 61 76 69 64 00"), null);
+        Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 "
+                + "01 00 00 8 "
+                "00 11 64 61 76 69 64 00"), null);
 
-        assertEquals(AfiListLcaf.class, address.getAddressType());
-        assertEquals("david", ((AfiList) address.getAddress()).getAfiList().getAddressList().get(0)
+        assertEquals(AfiListLcaf.VALUE, address.getAddressType());
+        assertEquals("david", ((AfiList) address.getAddress()).getAfiList().getAddressList().iterator().next()
                 .getDistinguishedNameType().getValue());
 
     }
 
     @Test(expected = LispSerializationException.class)
     public void deserialize__ShorterBuffer() throws Exception {
-        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "01 00 00 10 " + //
-                "00 11 64 61 76 69 64 00"), null);
+        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("""
+            40 03 00 00 \
+            01 00 00 10 \
+            00 11 64 61 76 69 64 00"""), null);
     }
 
     @Test(expected = LispSerializationException.class)
     public void deserialize__ShorterBuffer2() throws Exception {
-        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 " + //
-                "01 00 00 18 "), null);
+        LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer("40 03 00 00 "
+                "01 00 00 18 "), null);
     }
 
     @Test
@@ -89,14 +87,13 @@ public class DistinguishedNameSerializerTest extends BaseTestCase {
     @Test
     public void serialize__Simple() throws Exception {
         EidBuilder eb = new EidBuilder();
-        eb.setAddressType(DistinguishedNameAfi.class);
+        eb.setAddressType(DistinguishedNameAfi.VALUE);
         eb.setVirtualNetworkId(null);
         eb.setAddress(new DistinguishedNameBuilder().setDistinguishedName(new DistinguishedNameType("david")).build());
 
         ByteBuffer buf = ByteBuffer.allocate(LispAddressSerializer.getInstance().getAddressSize(eb.build()));
         LispAddressSerializer.getInstance().serialize(buf, eb.build());
         ByteBuffer expectedBuf = hexToByteBuffer("00 11 64 61 76 69 64 00");
-        ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+        assertArrayEquals(expectedBuf.array(), buf.array());
     }
-
 }