From cb12a2c410cf24b0bcef5257f30ce88e1cd99ab3 Mon Sep 17 00:00:00 2001 From: Suyash Nayan <89125422+7suyash7@users.noreply.github.com> Date: Mon, 12 Jun 2023 09:55:40 +0530 Subject: [PATCH] Migrate util module to JUnit 5.0 (#5581) Signed-off-by: 7suyash7 Co-authored-by: Sally MacFarlane --- util/build.gradle | 2 +- .../test/java/org/hyperledger/besu/util/ExceptionUtilsTest.java | 2 +- .../test/java/org/hyperledger/besu/util/FutureUtilsTest.java | 2 +- .../src/test/java/org/hyperledger/besu/util/LimitedSetTest.java | 2 +- .../test/java/org/hyperledger/besu/util/NetworkUtilityTest.java | 2 +- .../test/java/org/hyperledger/besu/util/SubscribersTest.java | 2 +- .../java/org/hyperledger/besu/util/number/FractionTest.java | 2 +- .../java/org/hyperledger/besu/util/number/PercentageTest.java | 2 +- .../org/hyperledger/besu/util/number/PositiveNumberTest.java | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/util/build.gradle b/util/build.gradle index 03fc3bca26..9136a20b7e 100644 --- a/util/build.gradle +++ b/util/build.gradle @@ -38,7 +38,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-slf4j2-impl' implementation 'org.xerial.snappy:snappy-java' - testImplementation 'junit:junit' + testImplementation 'org.mockito:mockito-junit-jupiter' testImplementation 'org.assertj:assertj-core' testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.mockito:mockito-core' diff --git a/util/src/test/java/org/hyperledger/besu/util/ExceptionUtilsTest.java b/util/src/test/java/org/hyperledger/besu/util/ExceptionUtilsTest.java index 072ad9bccf..721dd42a3a 100644 --- a/util/src/test/java/org/hyperledger/besu/util/ExceptionUtilsTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/ExceptionUtilsTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.concurrent.CompletionException; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ExceptionUtilsTest { diff --git a/util/src/test/java/org/hyperledger/besu/util/FutureUtilsTest.java b/util/src/test/java/org/hyperledger/besu/util/FutureUtilsTest.java index b0e76e6763..17b2076770 100644 --- a/util/src/test/java/org/hyperledger/besu/util/FutureUtilsTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/FutureUtilsTest.java @@ -29,7 +29,7 @@ import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FutureUtilsTest { diff --git a/util/src/test/java/org/hyperledger/besu/util/LimitedSetTest.java b/util/src/test/java/org/hyperledger/besu/util/LimitedSetTest.java index 804deffb52..1b84a681db 100644 --- a/util/src/test/java/org/hyperledger/besu/util/LimitedSetTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/LimitedSetTest.java @@ -20,7 +20,7 @@ import org.hyperledger.besu.util.LimitedSet.Mode; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class LimitedSetTest { diff --git a/util/src/test/java/org/hyperledger/besu/util/NetworkUtilityTest.java b/util/src/test/java/org/hyperledger/besu/util/NetworkUtilityTest.java index 6b0ac19466..74ea89fc7a 100644 --- a/util/src/test/java/org/hyperledger/besu/util/NetworkUtilityTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/NetworkUtilityTest.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.ServerSocket; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class NetworkUtilityTest { diff --git a/util/src/test/java/org/hyperledger/besu/util/SubscribersTest.java b/util/src/test/java/org/hyperledger/besu/util/SubscribersTest.java index 0ba25890b6..c5c4da3489 100644 --- a/util/src/test/java/org/hyperledger/besu/util/SubscribersTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/SubscribersTest.java @@ -21,7 +21,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoInteractions; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class SubscribersTest { private final Runnable subscriber1 = mock(Runnable.class); diff --git a/util/src/test/java/org/hyperledger/besu/util/number/FractionTest.java b/util/src/test/java/org/hyperledger/besu/util/number/FractionTest.java index a6e05f5954..551bbc374e 100644 --- a/util/src/test/java/org/hyperledger/besu/util/number/FractionTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/number/FractionTest.java @@ -17,7 +17,7 @@ package org.hyperledger.besu.util.number; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FractionTest { diff --git a/util/src/test/java/org/hyperledger/besu/util/number/PercentageTest.java b/util/src/test/java/org/hyperledger/besu/util/number/PercentageTest.java index 6a6e3db5d1..143305d7ea 100644 --- a/util/src/test/java/org/hyperledger/besu/util/number/PercentageTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/number/PercentageTest.java @@ -17,7 +17,7 @@ package org.hyperledger.besu.util.number; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PercentageTest { diff --git a/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java b/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java index 430e43ca6a..5e51e79e80 100644 --- a/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java +++ b/util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java @@ -17,7 +17,7 @@ package org.hyperledger.besu.util.number; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PositiveNumberTest {