Update TypeDefinition design
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / Int8Test.java
index 5bf00d6018ec3c76b8131d62275c27abe2d3c7c4..9387c7827cd65e5a223fc19d1c9683f8af31d8e2 100644 (file)
@@ -7,8 +7,11 @@
  */
 package org.opendaylight.yangtools.yang.model.util;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 
+import java.util.Optional;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
@@ -19,8 +22,9 @@ public class Int8Test {
     public void testInt8() {
         IntegerTypeDefinition int8 = BaseTypes.int8Type();
         IntegerTypeDefinition int8Second = BaseTypes.int8Type();
-        assertTrue("The method 'getInstance()' has to return the same instance", int8 == int8Second);
-        assertTrue("The method 'getBaseType()' is returning incorrect value", int8.getBaseType() == null);
-        assertTrue("The method 'getDefaultType()' is returning incorrect value", int8.getDefaultValue() == null);
+        assertSame("The method 'getInstance()' has to return the same instance", int8, int8Second);
+        assertNull("The method 'getBaseType()' is returning incorrect value", int8.getBaseType());
+        assertEquals("The method 'getDefaultType()' is returning incorrect value", Optional.empty(),
+            int8.getDefaultValue());
     }
 }