BUG-4688: Rework SchemaContext module lookups
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / ConstraintDefinitionsTest.java
index aa0f39bfb0f17d894846c9b798b736fc9797c505..6b60dd7c5e5db51999772ec8b0257fc7950689b4 100644 (file)
@@ -44,9 +44,7 @@ public class ConstraintDefinitionsTest {
         final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        final Module testModule = schemaContext.findModuleByName("foo", QName.parseRevision("2016-09-20"));
-        assertNotNull(testModule);
-
+        final Module testModule = schemaContext.findModule("foo", QName.parseRevision("2016-09-20")).get();
         final LeafSchemaNode mandatoryLeaf1 = (LeafSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "mandatory-leaf-1"));
         assertNotNull(mandatoryLeaf1);