BUG 2667 : Handle null value type
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / cluster / datastore / node / utils / serialization / ValueTypeTest.java
index 8fe0633b6e3fbdaf6f4dba52d945cc6b6d014c78..1280559c00c1ecd26d2ce621ddb64e64479f6263 100644 (file)
@@ -1,8 +1,7 @@
 package org.opendaylight.controller.cluster.datastore.node.utils.serialization;
 
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
+import org.junit.Test;
 
 public class ValueTypeTest {
 
@@ -15,4 +14,12 @@ public class ValueTypeTest {
         ValueType serializableType = ValueType.getSerializableType(b);
         assertEquals(ValueType.BINARY_TYPE, serializableType);
     }
+
+    @Test
+    public void testNullType(){
+        ValueType serializableType = ValueType.getSerializableType(null);
+        assertEquals(ValueType.NULL_TYPE, serializableType);
+
+        assertEquals(null, ValueType.NULL_TYPE.deserialize(""));
+    }
 }
\ No newline at end of file