Bug 4540: Yang parser exceptions should follow consistent path
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / test / SubstatementValidatorTest.java
index 294ceb9b7f0a55795b51d7f6985e4383bce3e04c..f4fe296a26ef73c6bcddef7b07013ce0d8518076 100644 (file)
@@ -22,6 +22,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.parser.spi.meta.MissingSubstatementException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.stmt.retest.TestUtils;
 
@@ -68,7 +69,7 @@ public class SubstatementValidatorTest {
 
     @Test
     public void missingElementException() throws URISyntaxException, ReactorException {
-        expectedEx.expect(IllegalStateException.class);
+        expectedEx.expect(MissingSubstatementException.class);
 
         Set<Module> modules = TestUtils.loadModules(getClass().getResource
                 ("/substatement-validator/missing-element").toURI());