diff --git a/.gitignore b/.gitignore index 0465ea5e30f..821bd6b725f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ .externalToolBuilders/ .gradle/ .idea/ +.vscode/ .loadpath .metadata .prefs diff --git a/besu/build.gradle b/besu/build.gradle index 73977d81ba7..9d72f50b021 100644 --- a/besu/build.gradle +++ b/besu/build.gradle @@ -90,7 +90,7 @@ dependencies { testImplementation 'com.squareup.okhttp3:okhttp' testImplementation 'commons-io:commons-io' testImplementation 'io.opentelemetry:opentelemetry-api' - testImplementation 'junit:junit' + testImplementation 'org.mockito:mockito-junit-jupiter' testImplementation 'org.apache.commons:commons-text' testImplementation 'io.tmio:tuweni-bytes' testImplementation 'io.tmio:tuweni-units' diff --git a/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java b/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java index f9d543aca9f..d65569535aa 100644 --- a/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java +++ b/besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java @@ -41,23 +41,21 @@ import java.util.concurrent.CompletionException; import org.apache.tuweni.units.bigints.UInt256; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.io.TempDir; +import org.mockito.junit.jupiter.MockitoExtension; /** Tests for {@link RlpBlockImporter}. */ -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class RlpBlockImporterTest { - @Rule public final TemporaryFolder folder = new TemporaryFolder(); + @TempDir Path dataDir; private final RlpBlockImporter rlpBlockImporter = new RlpBlockImporter(); @Test public void blockImport() throws IOException { - final Path dataDir = folder.newFolder().toPath(); final Path source = dataDir.resolve("1000.blocks"); BlockTestUtil.write1000Blocks(source); final BesuController targetController = @@ -90,7 +88,6 @@ public void blockImportRejectsBadPow() throws IOException { // set merge flag to false, otherwise this test can fail if a merge test runs first MergeConfigOptions.setMergeEnabled(false); - final Path dataDir = folder.newFolder().toPath(); final Path source = dataDir.resolve("badpow.blocks"); BlockTestUtil.writeBadPowBlocks(source); final BesuController targetController = @@ -120,7 +117,6 @@ public void blockImportRejectsBadPow() throws IOException { @Test public void blockImportCanSkipPow() throws IOException { - final Path dataDir = folder.newFolder().toPath(); final Path source = dataDir.resolve("badpow.blocks"); BlockTestUtil.writeBadPowBlocks(source); final BesuController targetController =