Move Bug4079/Bug5410 tests from yang-parser to yang-model-util
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / BitsTypeTest.java
index 399c24d7ebd86129726836f4ca3e073e555e4534..4714fb2b8c513f69e0fb42418333a4fe022e80d2 100644 (file)
@@ -14,6 +14,7 @@ import static org.junit.Assert.assertNull;
 import static org.mockito.Mockito.doReturn;
 
 import java.util.Collections;
+import java.util.Optional;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -34,17 +35,17 @@ public class BitsTypeTest {
         doReturn("test").when(bit).getName();
 
         QName qname = QName.create("namespace", "localname");
-        SchemaPath schemaPath = SchemaPath.create(Collections.singletonList(qname), true);
+        SchemaPath schemaPath = SchemaPath.create(true, qname);
 
         BitsTypeDefinition bitsType = BaseTypes.bitsTypeBuilder(schemaPath).addBit(bit).build();
 
         assertFalse(bitsType.getDescription().isPresent());
         assertEquals("QName", qname, bitsType.getQName());
-        assertNull("Should be null", bitsType.getUnits());
+        assertEquals(Optional.empty(), bitsType.getUnits());
         assertNotEquals("Description should not be null", null, bitsType.toString());
         assertFalse(bitsType.getReference().isPresent());
         assertNull("BaseType should be null", bitsType.getBaseType());
-        assertNull("Default value should be null", bitsType.getDefaultValue());
+        assertEquals(Optional.empty(), bitsType.getDefaultValue());
         assertEquals("getPath should equal schemaPath", schemaPath, bitsType.getPath());
         assertEquals("Status should be CURRENT", Status.CURRENT, bitsType.getStatus());
         assertEquals("Should be empty list", Collections.EMPTY_LIST, bitsType.getUnknownSchemaNodes());