Remove yang.model.util.BaseTypes
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / EmptyTypeTest.java
index f8924835ec938876e26bce26b3e67c1d6f6414d3..470e0c9605fa278e2e01f7dddf81082f30069479 100644 (file)
@@ -7,31 +7,30 @@
  */
 package org.opendaylight.yangtools.yang.model.util;
 
-import org.junit.Test;
-import org.opendaylight.yangtools.yang.model.api.Status;
-
-import java.util.Collections;
-
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.opendaylight.yangtools.yang.model.util.type.BaseTypes.emptyType;
 
-public class EmptyTypeTest {
+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.EmptyTypeDefinition;
 
+public class EmptyTypeTest {
     @Test
     public void canCreateEmptyType() {
-        EmptyType emptyType = EmptyType.getInstance();
+        EmptyTypeDefinition emptyType = emptyType();
 
-        assertEquals("QName", BaseTypes.EMPTY_QNAME, emptyType.getQName());
-        assertEquals("Path", Collections.singletonList(BaseTypes.EMPTY_QNAME),
-                emptyType.getPath().getPathFromRoot());
+        assertEquals("QName", EmptyTypeDefinition.QNAME, emptyType.getQName());
         assertEquals("BaseType", null, emptyType.getBaseType());
-        assertEquals("DefaultValue", null, emptyType.getDefaultValue());
+        assertEquals("DefaultValue", Optional.empty(), emptyType.getDefaultValue());
         assertEquals("Status", Status.CURRENT, emptyType.getStatus());
-        assertTrue("Reference", emptyType.getReference().contains("rfc6020"));
-        assertEquals("Units", null, emptyType.getUnits());
-        assertNotEquals("Description is not null", null, emptyType.getDescription());
-        assertEquals("UnknownSchemaNodes", Collections.EMPTY_LIST, emptyType.getUnknownSchemaNodes());
+        assertFalse(emptyType.getReference().isPresent());
+        assertEquals("Units", Optional.empty(), emptyType.getUnits());
+        assertFalse(emptyType.getDescription().isPresent());
+        assertEquals("UnknownSchemaNodes", Collections.emptyList(), emptyType.getUnknownSchemaNodes());
         assertTrue("toString", emptyType.toString().contains("empty"));
     }
-}
\ No newline at end of file
+}