migrate to junit5 (#6234)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6253/head
Sally MacFarlane 12 months ago committed by Jason Frame
parent 9aaaf79c59
commit c4fce13020
  1. 1
      crypto/algorithms/build.gradle
  2. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/ECPointUtilTest.java
  3. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/HashTest.java
  4. 6
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/KeyPairTest.java
  5. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/KeyPairUtilTest.java
  6. 10
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SECP256K1Test.java
  7. 10
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SECP256R1Test.java
  8. 6
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SECPPrivateKeyTest.java
  9. 6
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SECPPublicKeyTest.java
  10. 6
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SECPSignatureTest.java
  11. 6
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SignatureAlgorithmFactoryTest.java
  12. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/SignatureAlgorithmTypeTest.java
  13. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12PairerTest.java
  14. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12PointTest.java
  15. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq2PointTest.java
  16. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/AltBn128PointTest.java
  17. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/Fq12Test.java
  18. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/Fq2Test.java
  19. 2
      crypto/algorithms/src/test/java/org/hyperledger/besu/crypto/altbn128/FqTest.java

@ -40,7 +40,6 @@ dependencies {
implementation 'org.hyperledger.besu:blake2bf'
implementation 'com.google.guava:guava'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'

@ -20,7 +20,7 @@ import java.math.BigInteger;
import java.security.spec.ECPoint;
import org.apache.tuweni.bytes.Bytes;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class ECPointUtilTest {

@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import org.apache.tuweni.bytes.Bytes;
import org.bouncycastle.util.encoders.Hex;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class HashTest {

@ -28,8 +28,8 @@ import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.x9.X9ECParameters;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class KeyPairTest {
public static final String ALGORITHM = SignatureAlgorithm.ALGORITHM;
@ -39,7 +39,7 @@ public class KeyPairTest {
public static KeyPairGenerator keyPairGenerator;
public static ECDomainParameters curve;
@BeforeClass
@BeforeAll
public static void setUp() {
Security.addProvider(new BouncyCastleProvider());

@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.io.File;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class KeyPairUtilTest {

@ -28,9 +28,9 @@ import java.time.format.DateTimeFormatter;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class SECP256K1Test {
@ -39,7 +39,7 @@ public class SECP256K1Test {
protected static String suiteStartTime = null;
protected static String suiteName = null;
@BeforeClass
@BeforeAll
public static void setTestSuiteStartTime() {
suiteStartTime =
LocalDateTime.now(ZoneId.systemDefault())
@ -47,7 +47,7 @@ public class SECP256K1Test {
suiteName(SECP256K1Test.class);
}
@Before
@BeforeEach
public void setUp() {
secp256K1 = new SECP256K1();
}

@ -29,9 +29,9 @@ import java.util.List;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class SECP256R1Test {
@ -103,7 +103,7 @@ public class SECP256R1Test {
protected static String suiteStartTime = null;
protected static String suiteName = null;
@BeforeClass
@BeforeAll
public static void setTestSuiteStartTime() {
suiteStartTime =
LocalDateTime.now(ZoneId.systemDefault())
@ -113,7 +113,7 @@ public class SECP256R1Test {
SignatureAlgorithmFactory.setInstance(SignatureAlgorithmType.create("secp256r1"));
}
@Before
@BeforeEach
public void setUp() {
secp256R1 = new SECP256R1();
}

@ -29,8 +29,8 @@ import org.apache.tuweni.bytes.Bytes32;
import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.x9.X9ECParameters;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class SECPPrivateKeyTest {
public static final String ALGORITHM = SignatureAlgorithm.ALGORITHM;
@ -40,7 +40,7 @@ public class SECPPrivateKeyTest {
protected static String suiteName = null;
public static ECDomainParameters curve;
@BeforeClass
@BeforeAll
public static void setUp() {
suiteStartTime =
LocalDateTime.now(ZoneId.systemDefault())

@ -24,8 +24,8 @@ import org.apache.tuweni.bytes.Bytes;
import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.x9.X9ECParameters;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class SECPPublicKeyTest {
public static final String ALGORITHM = SignatureAlgorithm.ALGORITHM;
@ -33,7 +33,7 @@ public class SECPPublicKeyTest {
public ECDomainParameters curve;
@Before
@BeforeEach
public void setUp() {
final X9ECParameters params = SECNamedCurves.getByName(CURVE_NAME);
curve = new ECDomainParameters(params.getCurve(), params.getG(), params.getN(), params.getH());

@ -22,15 +22,15 @@ import java.math.BigInteger;
import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.x9.X9ECParameters;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class SECPSignatureTest {
public static final String CURVE_NAME = "secp256k1";
public static BigInteger curveOrder;
@BeforeClass
@BeforeAll
public static void setUp() {
final X9ECParameters params = SECNamedCurves.getByName(CURVE_NAME);
final ECDomainParameters curve =

@ -17,12 +17,12 @@ package org.hyperledger.besu.crypto;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class SignatureAlgorithmFactoryTest {
@Before
@BeforeEach
public void setUp() {
SignatureAlgorithmFactory.resetInstance();
}

@ -17,7 +17,7 @@ package org.hyperledger.besu.crypto;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class SignatureAlgorithmTypeTest {
@Test

@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

@ -16,7 +16,7 @@ package org.hyperledger.besu.crypto.altbn128;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* Adapted from the pc_ecc (Apache 2 License) implementation:

Loading…
Cancel
Save