This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch elasticity in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/elasticity by this push: new 87164a8ae5 Fix direct use of junit transitive dependency 87164a8ae5 is described below commit 87164a8ae56f33b3b930e3b05e4ce0bd52724a42 Author: Christopher Tubbs <ctubb...@apache.org> AuthorDate: Thu Dec 21 05:49:21 2023 -0500 Fix direct use of junit transitive dependency * Remove the direct use of the junit transitive dependency, opentest4j, which junit uses internally * Replace use of try-catch with fail() and checking for opentest4j's AssertionFailedError with a simpler junit assertThrows and validation of the thrown exception's cause being an instanceof AssertionError --- pom.xml | 5 ----- test/pom.xml | 4 ---- .../main/java/org/apache/accumulo/test/ScanServerIT.java | 13 +++---------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index a9e733acb0..9b3a93bd79 100644 --- a/pom.xml +++ b/pom.xml @@ -606,11 +606,6 @@ </exclusion> </exclusions> </dependency> - <dependency> - <groupId>org.opentest4j</groupId> - <artifactId>opentest4j</artifactId> - <version>1.2.0</version> - </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> diff --git a/test/pom.xml b/test/pom.xml index c1b13d53c6..1bc4fc64c2 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -202,10 +202,6 @@ <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-params</artifactId> </dependency> - <dependency> - <groupId>org.opentest4j</groupId> - <artifactId>opentest4j</artifactId> - </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> diff --git a/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java b/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java index 75e791480f..20c2780743 100644 --- a/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; -import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Duration; import java.util.ArrayList; @@ -80,7 +80,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import org.opentest4j.AssertionFailedError; import com.google.common.collect.Iterables; @@ -320,14 +319,8 @@ public class ScanServerIT extends SharedMiniClusterBase { assertEquals(4, futures.size()); futures.forEach(f -> { - try { - f.get(); - fail("Scanner should have timed out"); - } catch (ExecutionException e) { - assertEquals(AssertionFailedError.class, e.getCause().getClass()); - } catch (InterruptedException e) { - fail("Scan was interrupted"); - } + var e = assertThrows(ExecutionException.class, () -> f.get()); + assertTrue(e.getCause() instanceof AssertionError); }); } // when the scanner is closed, all open sessions should be closed executor.shutdown();