Reduce use of getChildByName()
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / schema / BuilderTest.java
index 20a20333ae1323793b2089dd3fb045c36aec6637..4af3852aad68860210f1a98afff7ef87ba26a1f5 100644 (file)
@@ -95,9 +95,9 @@ public class BuilderTest {
                 .toURI());
         final SchemaContext schema = YangParserTestUtils.parseYangFiles(leafRefTestYang);
         final Module module = schema.getModules().iterator().next();
-        final DataSchemaNode root = module.getDataChildByName(ROOT_CONTAINER);
-        list = (ListSchemaNode)((ContainerSchemaNode) root).getDataChildByName(LIST_MAIN);
-        leafList = (LeafListSchemaNode)((ContainerSchemaNode) root).getDataChildByName(LEAF_LIST_MAIN);
+        final DataSchemaNode root = module.findDataChildByName(ROOT_CONTAINER).get();
+        list = (ListSchemaNode)((ContainerSchemaNode) root).findDataChildByName(LIST_MAIN).get();
+        leafList = (LeafListSchemaNode)((ContainerSchemaNode) root).findDataChildByName(LEAF_LIST_MAIN).get();
     }
 
     @Test