Migrate yang-parser-impl to JUnit5
[yangtools.git] / parser / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / repo / YT1428Test.java
index b9500aca0b85335050fa7700ec7c575271b9b60f..0379e03b3bea1aa101ed2837aa5f2c5eeb6760a3 100644 (file)
@@ -7,19 +7,18 @@
  */
 package org.opendaylight.yangtools.yang.parser.repo;
 
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 
 public class YT1428Test extends AbstractSchemaRepositoryTest {
     @Test
     public void testDeviateSourceReported() {
-        final var cause = assertExecutionException(null, "/yt1428/orig.yang", "/yt1428/deviate.yang").getCause();
-        assertThat(cause, instanceOf(SchemaResolutionException.class));
-        assertEquals(new SourceIdentifier("deviate"), ((SchemaResolutionException) cause).getFailedSource());
+        final var ex = assertExecutionException(null, "/yt1428/orig.yang", "/yt1428/deviate.yang");
+        assertEquals(new SourceIdentifier("deviate"),
+            assertInstanceOf(SchemaResolutionException.class, ex.getCause()).getFailedSource());
     }
 }