Update TypeDefinition design
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / BinaryTypeTest.java
index db4e2dd475f2134f5387c575988ae88d102a9234..8cf01ae3e30387c579368e472cc47bff6fe3c21c 100644 (file)
@@ -9,11 +9,11 @@ package org.opendaylight.yangtools.yang.model.util;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.opendaylight.yangtools.yang.model.util.type.BaseTypes.binaryType;
 
 import java.util.Collections;
+import java.util.Optional;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.Status;
 import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
@@ -26,16 +26,15 @@ public class BinaryTypeTest {
         final BinaryTypeDefinition binType1 = binaryType();
 
         assertFalse(binType.getLengthConstraint().isPresent());
-        assertNull(binType.getDefaultValue());
+        assertEquals(Optional.empty(), binType.getDefaultValue());
         assertEquals("CURRENT", Status.CURRENT, binType.getStatus());
         assertEquals("Base type is null", null, binType.getBaseType());
         assertEquals("getQName gives BINARY_QNAME", BaseTypes.BINARY_QNAME, binType.getQName());
-        assertNull("Units should be null", binType.getUnits());
-        assertEquals("getPath gives List of BINARY_QNAME",
-                Collections.singletonList(BaseTypes.BINARY_QNAME), binType.getPath().getPathFromRoot());
+        assertEquals(Optional.empty(), binType.getUnits());
+        assertEquals("getPath gives List of BINARY_QNAME", Collections.singletonList(BaseTypes.BINARY_QNAME),
+            binType.getPath().getPathFromRoot());
 
-        assertTrue("binType1 should equal to binType",
-                binType.equals(binType1) && binType1.equals(binType));
+        assertTrue("binType1 should equal to binType", binType.equals(binType1) && binType1.equals(binType));
         assertTrue("Hash code of binType and binType1 should be equal",
                 binType.hashCode() == binType1.hashCode());
         assertEquals("binType should equals to itself", binType, binType);