ethereum/part8 - migrated tests from Junit4 to Junit5 (#5720)

Signed-off-by: Nischal Sharma <nischal@web3labs.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/5724/head
Nischal Sharma 1 year ago committed by GitHub
parent dbd27f05ca
commit d923b8eb8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ethereum/retesteth/build.gradle
  2. 6
      ethereum/retesteth/src/test/java/org/hyperledger/besu/ethereum/retesteth/methods/TestImportRawBlockTest.java
  3. 6
      ethereum/retesteth/src/test/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParamsTest.java
  4. 3
      ethereum/rlp/build.gradle
  5. 2
      ethereum/rlp/src/test/java/org/hyperledger/besu/ethereum/rlp/BytesValueRLPInputTest.java
  6. 2
      ethereum/rlp/src/test/java/org/hyperledger/besu/ethereum/rlp/BytesValueRLPOutputTest.java
  7. 2
      ethereum/rlp/src/test/java/org/hyperledger/besu/ethereum/rlp/RLPTest.java
  8. 4
      ethereum/trie/build.gradle
  9. 8
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/AllNodesVisitorTest.java
  10. 2
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/CompactEncodingTest.java
  11. 2
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/RangeStorageEntriesCollectorTest.java
  12. 2
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/SnapPutVisitorTest.java
  13. 2
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieIteratorTest.java
  14. 2
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/TrieNodeDecoderTest.java
  15. 8
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/AbstractMerklePatriciaTrieTest.java
  16. 2
      ethereum/trie/src/test/java/org/hyperledger/besu/ethereum/trie/patricia/StoredMerklePatriciaTrieTest.java
  17. 3
      ethereum/verkletrie/build.gradle
  18. 2
      ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fp/ElementTest.java
  19. 2
      ethereum/verkletrie/src/test/java/org/hyperledger/besu/ethereum/verkletrie/bandersnatch/fr/ElementTest.java

@ -50,10 +50,7 @@ dependencies {
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

@ -31,15 +31,15 @@ import java.io.IOException;
import com.google.common.base.Charsets;
import com.google.common.io.Resources;
import io.vertx.core.json.JsonObject;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestImportRawBlockTest {
private TestImportRawBlock test_importRawBlock;
private TestRewindToBlock test_rewindToBlock;
private RetestethContext context;
@Before
@BeforeEach
public void setupClass() throws IOException {
context = new RetestethContext();
test_importRawBlock = new TestImportRawBlock(context);

@ -29,15 +29,15 @@ import com.google.common.base.Charsets;
import com.google.common.io.Resources;
import io.vertx.core.json.JsonObject;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class TestSetChainParamsTest {
private static RetestethContext context;
private static TestSetChainParams test_setChainParams;
@BeforeClass
@BeforeAll
public static void setupClass() {
context = new RetestethContext();
test_setChainParams = new TestSetChainParams(context);

@ -41,11 +41,8 @@ dependencies {
testImplementation project(':testutil')
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}
artifacts { testSupportArtifacts testSupportJar }

@ -23,7 +23,7 @@ import java.util.function.Function;
import org.apache.tuweni.bytes.Bytes;
import org.assertj.core.api.AssertionsForClassTypes;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class BytesValueRLPInputTest {

@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class BytesValueRLPOutputTest {

@ -22,7 +22,7 @@ import org.hyperledger.besu.ethereum.rlp.util.RLPTestUtil;
import java.util.Random;
import org.apache.tuweni.bytes.Bytes;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class RLPTest {

@ -45,11 +45,9 @@ dependencies {
testImplementation project(':testutil')
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit'
testImplementation 'io.tmio:tuweni-units'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testImplementation 'org.mockito:mockito-junit-jupiter'
}

@ -22,12 +22,12 @@ import org.hyperledger.besu.ethereum.trie.patricia.ExtensionNode;
import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.junit.jupiter.MockitoExtension;
@RunWith(MockitoJUnitRunner.class)
@ExtendWith(MockitoExtension.class)
public class AllNodesVisitorTest {
@Mock private StoredNode<String> storedNode;

@ -23,7 +23,7 @@ import java.util.Random;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class CompactEncodingTest {

@ -22,7 +22,7 @@ import java.util.List;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class RangeStorageEntriesCollectorTest {

@ -31,7 +31,7 @@ import java.util.function.Function;
import org.apache.tuweni.bytes.Bytes;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.jupiter.api.Test;
@SuppressWarnings("unchecked")
public class SnapPutVisitorTest {

@ -38,7 +38,7 @@ import java.util.TreeSet;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
public class TrieIteratorTest {

@ -31,7 +31,7 @@ import java.util.stream.Collectors;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class TrieNodeDecoderTest {

@ -15,9 +15,9 @@
package org.hyperledger.besu.ethereum.trie.patricia;
import static java.nio.charset.StandardCharsets.UTF_8;
import static junit.framework.TestCase.assertFalse;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertFalse;
import org.hyperledger.besu.ethereum.trie.CompactEncoding;
import org.hyperledger.besu.ethereum.trie.KeyValueMerkleStorage;
@ -33,13 +33,13 @@ import java.util.Optional;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public abstract class AbstractMerklePatriciaTrieTest {
protected MerkleTrie<Bytes, String> trie;
@Before
@BeforeEach
public void setup() {
trie = createTrie();
}

@ -28,7 +28,7 @@ import java.util.function.Function;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class StoredMerklePatriciaTrieTest extends AbstractMerklePatriciaTrieTest {
private KeyValueStorage keyValueStore;

@ -47,11 +47,8 @@ dependencies {
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
testImplementation 'junit:junit'
testImplementation 'io.tmio:tuweni-units'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class ElementTest {

@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.apache.tuweni.units.bigints.UInt256;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class ElementTest {

Loading…
Cancel
Save