Unit tests for ofoverlay
[groupbasedpolicy.git] / renderers / ofoverlay / src / test / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / arp / ArpUtilsTest.java
index 7e46d96217ada5ac18525bfa54187f554e774948..3586f03bbfd68554930e44254ed2b9f786561c28 100644 (file)
@@ -8,6 +8,9 @@
 
 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.arp;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 import java.net.InetAddress;
 
 import org.junit.Assert;
@@ -67,4 +70,11 @@ public class ArpUtilsTest {
         Assert.assertTrue(
                 result.contains("getTargetProtocolAddress()=" + InetAddress.getByAddress(tpa).getHostAddress()));
     }
+
+    @Test
+    public void testBytesToMac(){
+        byte[] macBytes = {0,1,0,1,0,1};
+        assertEquals(new MacAddress("00:01:00:01:00:01"), ArpUtils.bytesToMac(macBytes));
+        assertNull(ArpUtils.bytesToMac(null));
+    }
 }