package org.opendaylight.yangtools.yang.stmt;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
assertTrue(dataChildByName instanceof ContainerSchemaNode);
ContainerSchemaNode topContainer = (ContainerSchemaNode) dataChildByName;
- RevisionAwareXPath whenConditionTopContainer = topContainer.getConstraints().getWhenCondition();
- assertNull(whenConditionTopContainer);
+ assertFalse(topContainer.getConstraints().getWhenCondition().isPresent());
assertEquals(Status.CURRENT, topContainer.getStatus());
assertNull(topContainer.getDescription());
assertNull(topContainer.getReference());
assertTrue(dataChildByName2 instanceof LeafSchemaNode);
LeafSchemaNode extendedLeaf = (LeafSchemaNode) dataChildByName2;
- RevisionAwareXPath whenConditionExtendedLeaf = extendedLeaf.getConstraints().getWhenCondition();
+ RevisionAwareXPath whenConditionExtendedLeaf = extendedLeaf.getConstraints().getWhenCondition().get();
assertEquals(new RevisionAwareXPathImpl("module1:top = 'extended'", false), whenConditionExtendedLeaf);
assertEquals(Status.DEPRECATED, extendedLeaf.getStatus());