Use assertInstanceOf 42/101542/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 9 Jun 2022 10:04:13 +0000 (12:04 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 9 Jun 2022 10:04:13 +0000 (12:04 +0200)
No need to use Hamcrest, as we have a JUnit5 version of this assertion.

Change-Id: Ibe915ea3d74bff941237d33ad33d002180958590
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-repo-fs/src/test/java/org/opendaylight/yangtools/yang/model/repo/fs/FilesystemSchemaSourceCacheIntegrationTest.java

index 5a66878e84fab4f08bd86f4af83910bbe6dd476f..e3a4df57b900d990e5ff7ff75dc122ea2c1b566b 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.repo.fs;
 
 import static org.hamcrest.CoreMatchers.both;
 import static org.hamcrest.CoreMatchers.hasItem;
-import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.opendaylight.yangtools.util.concurrent.FluentFutures.immediateFluentFuture;
 
@@ -137,7 +137,7 @@ public class FilesystemSchemaSourceCacheIntegrationTest {
                 .createEffectiveModelContext(runningId);
 
         final var cause = assertThrows(ExecutionException.class, () -> Futures.getDone(schemaFuture)).getCause();
-        assertThat(cause, instanceOf(MissingSchemaSourceException.class));
+        assertInstanceOf(MissingSchemaSourceException.class, cause);
 
         // Creation of schema context fails, since we do not provide regular sources, but we just want
         // to check cache