BUG-4688: align Optional/nullable Date usage
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / TypesResolutionTest.java
index e9d2a17356a6e540f9505ce2c74394b6f75e0105..423a01f22534b9cfde7e6b27ab4e16b870d16b07 100644 (file)
@@ -19,6 +19,7 @@ import com.google.common.collect.Iterables;
 import com.google.common.collect.Range;
 import java.net.URI;
 import java.util.List;
+import java.util.Optional;
 import java.util.Set;
 import org.junit.Before;
 import org.junit.Test;
@@ -282,7 +283,7 @@ public class TypesResolutionTest {
 
         QName testedTypeQName = testedType.getQName();
         assertEquals(URI.create("urn:ietf:params:xml:ns:yang:iana-timezones"), testedTypeQName.getNamespace());
-        assertEquals(TestUtils.createDate("2012-07-09"), testedTypeQName.getRevision());
+        assertEquals(Optional.of(QName.parseRevision("2012-07-09")), testedTypeQName.getRevision());
         assertEquals("iana-timezone", testedTypeQName.getLocalName());
 
         EnumTypeDefinition enumType = (EnumTypeDefinition) testedType.getBaseType();
@@ -314,7 +315,7 @@ public class TypesResolutionTest {
 
         QName testedTypeQName = testedType.getQName();
         assertEquals(URI.create("urn:ietf:params:xml:ns:yang:ietf-yang-types"), testedTypeQName.getNamespace());
-        assertEquals(TestUtils.createDate("2010-09-24"), testedTypeQName.getRevision());
+        assertEquals(Optional.of(QName.parseRevision("2010-09-24")), testedTypeQName.getRevision());
         assertEquals("object-identifier-128", testedTypeQName.getLocalName());
 
         StringTypeDefinition testedTypeBase = testedType.getBaseType();
@@ -327,7 +328,7 @@ public class TypesResolutionTest {
 
         QName testedTypeBaseQName = testedTypeBase.getQName();
         assertEquals(URI.create("urn:ietf:params:xml:ns:yang:ietf-yang-types"), testedTypeBaseQName.getNamespace());
-        assertEquals(TestUtils.createDate("2010-09-24"), testedTypeBaseQName.getRevision());
+        assertEquals(Optional.of(QName.parseRevision("2010-09-24")), testedTypeBaseQName.getRevision());
         assertEquals("object-identifier", testedTypeBaseQName.getLocalName());
     }
 
@@ -339,7 +340,7 @@ public class TypesResolutionTest {
         IdentityrefTypeDefinition baseType = (IdentityrefTypeDefinition) testedType.getBaseType();
         QName identity = baseType.getIdentity().getQName();
         assertEquals(URI.create("urn:custom.types.demo"), identity.getNamespace());
-        assertEquals(TestUtils.createDate("2012-04-16"), identity.getRevision());
+        assertEquals(Optional.of(QName.parseRevision("2012-04-16")), identity.getRevision());
         assertEquals("service-type", identity.getLocalName());
 
         LeafSchemaNode type = (LeafSchemaNode) tested.getDataChildByName(QName.create(tested.getQNameModule(), "type"));