|
41 | 41 | import java.util.concurrent.CompletionException; |
42 | 42 |
|
43 | 43 | import org.apache.tuweni.units.bigints.UInt256; |
44 | | -import org.junit.Rule; |
45 | 44 | import org.junit.jupiter.api.Test; |
46 | | -import org.junit.rules.TemporaryFolder; |
47 | 45 | import org.junit.jupiter.api.extension.ExtendWith; |
| 46 | +import org.junit.jupiter.api.io.TempDir; |
48 | 47 | import org.mockito.junit.jupiter.MockitoExtension; |
49 | 48 |
|
50 | 49 | /** Tests for {@link RlpBlockImporter}. */ |
51 | 50 | @ExtendWith(MockitoExtension.class) |
52 | 51 | public final class RlpBlockImporterTest { |
53 | 52 |
|
54 | | - @Rule public final TemporaryFolder folder = new TemporaryFolder(); |
| 53 | + @TempDir Path dataDir; |
55 | 54 |
|
56 | 55 | private final RlpBlockImporter rlpBlockImporter = new RlpBlockImporter(); |
57 | 56 |
|
58 | 57 | @Test |
59 | 58 | public void blockImport() throws IOException { |
60 | | - final Path dataDir = folder.newFolder().toPath(); |
61 | 59 | final Path source = dataDir.resolve("1000.blocks"); |
62 | 60 | BlockTestUtil.write1000Blocks(source); |
63 | 61 | final BesuController targetController = |
@@ -90,7 +88,6 @@ public void blockImportRejectsBadPow() throws IOException { |
90 | 88 | // set merge flag to false, otherwise this test can fail if a merge test runs first |
91 | 89 | MergeConfigOptions.setMergeEnabled(false); |
92 | 90 |
|
93 | | - final Path dataDir = folder.newFolder().toPath(); |
94 | 91 | final Path source = dataDir.resolve("badpow.blocks"); |
95 | 92 | BlockTestUtil.writeBadPowBlocks(source); |
96 | 93 | final BesuController targetController = |
@@ -120,7 +117,6 @@ public void blockImportRejectsBadPow() throws IOException { |
120 | 117 |
|
121 | 118 | @Test |
122 | 119 | public void blockImportCanSkipPow() throws IOException { |
123 | | - final Path dataDir = folder.newFolder().toPath(); |
124 | 120 | final Path source = dataDir.resolve("badpow.blocks"); |
125 | 121 | BlockTestUtil.writeBadPowBlocks(source); |
126 | 122 | final BesuController targetController = |
|
0 commit comments