Skip to content

Commit 76bc9ec

Browse files
committed
#5571migrate-tests-to-Junit5
Signed-off-by: Fabio Pirola <fspirola@gmail.com>
1 parent 6a5ebf1 commit 76bc9ec

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,21 @@
4141
import java.util.concurrent.CompletionException;
4242

4343
import org.apache.tuweni.units.bigints.UInt256;
44-
import org.junit.Rule;
4544
import org.junit.jupiter.api.Test;
46-
import org.junit.rules.TemporaryFolder;
4745
import org.junit.jupiter.api.extension.ExtendWith;
46+
import org.junit.jupiter.api.io.TempDir;
4847
import org.mockito.junit.jupiter.MockitoExtension;
4948

5049
/** Tests for {@link RlpBlockImporter}. */
5150
@ExtendWith(MockitoExtension.class)
5251
public final class RlpBlockImporterTest {
5352

54-
@Rule public final TemporaryFolder folder = new TemporaryFolder();
53+
@TempDir Path dataDir;
5554

5655
private final RlpBlockImporter rlpBlockImporter = new RlpBlockImporter();
5756

5857
@Test
5958
public void blockImport() throws IOException {
60-
final Path dataDir = folder.newFolder().toPath();
6159
final Path source = dataDir.resolve("1000.blocks");
6260
BlockTestUtil.write1000Blocks(source);
6361
final BesuController targetController =
@@ -90,7 +88,6 @@ public void blockImportRejectsBadPow() throws IOException {
9088
// set merge flag to false, otherwise this test can fail if a merge test runs first
9189
MergeConfigOptions.setMergeEnabled(false);
9290

93-
final Path dataDir = folder.newFolder().toPath();
9491
final Path source = dataDir.resolve("badpow.blocks");
9592
BlockTestUtil.writeBadPowBlocks(source);
9693
final BesuController targetController =
@@ -120,7 +117,6 @@ public void blockImportRejectsBadPow() throws IOException {
120117

121118
@Test
122119
public void blockImportCanSkipPow() throws IOException {
123-
final Path dataDir = folder.newFolder().toPath();
124120
final Path source = dataDir.resolve("badpow.blocks");
125121
BlockTestUtil.writeBadPowBlocks(source);
126122
final BesuController targetController =

ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/peers/EnodeURLImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ public void toURI_WithHostnameShouldWorkWhenDnsEnabledAndUpdateEnabled()
500500
"enode://"
501501
+ VALID_NODE_ID
502502
+ "@"
503-
+ InetAddress.getLocalHost().getCanonicalHostName()
503+
+ InetAddress.getLocalHost().getHostName()
504504
+ ":"
505505
+ P2P_PORT;
506506
final URI expectedURI = URI.create(enodeURLString);

0 commit comments

Comments
 (0)