Port yang-parser-rfc7950 to JUnit 5
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / ParsingExtensionValueTest.java
index e1fb43fb53db9b0fbcd2196d044f0da32daf4ddb..0964f258e24f9802a02324ad14e4669745648c26 100644 (file)
@@ -7,28 +7,16 @@
  */
 package org.opendaylight.yangtools.yang.stmt;
 
-import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.CoreMatchers.startsWith;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
 
-import org.junit.Test;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test for testing of extensions and their arguments.
  */
-public class ParsingExtensionValueTest {
+class ParsingExtensionValueTest extends AbstractYangTest {
     @Test
-    public void extensionTest() {
-        final ReactorException ex = assertThrows(ReactorException.class,
-            () -> TestUtils.loadModules(getClass().getResource("/extensions").toURI()));
-        assertEquals(SomeModifiersUnresolvedException.class, ex.getClass());
-        final Throwable cause = ex.getCause();
-        assertThat(cause, instanceOf(SourceException.class));
-        assertThat(cause.getMessage(), startsWith("ext:id is not a YANG statement or use of extension"));
+    void extensionTest() {
+        assertSourceExceptionDir("/extensions", startsWith("ext:id is not a YANG statement or use of extension"));
     }
 }