Use JUnit 5 for unit test execution (#3620)

Change the unit test execution to use the Junit5 JUnitPlatform. This
allows for a mix of junit 4 and junit 5 tests and for a gradual
migration to junit 5 instead of a big bang. One class depended on
junit 4 exceptions and was updated. Two tests depending on 
native libraries fail gracefully on mac (and only mac).

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/3683/head
Danno Ferrin 3 years ago committed by GitHub
parent 17d00e51ae
commit b4027d6e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CHANGELOG.md
  2. 5
      acceptance-tests/test-plugins/build.gradle
  3. 12
      acceptance-tests/tests/build.gradle
  4. 7
      besu/build.gradle
  5. 1
      build.gradle
  6. 3
      config/build.gradle
  7. 3
      consensus/clique/build.gradle
  8. 5
      consensus/common/build.gradle
  9. 5
      consensus/ibft/build.gradle
  10. 3
      consensus/ibftlegacy/build.gradle
  11. 3
      consensus/merge/build.gradle
  12. 12
      consensus/qbft/build.gradle
  13. 3
      container-tests/tests/build.gradle
  14. 3
      crypto/build.gradle
  15. 3
      datatypes/build.gradle
  16. 3
      enclave/build.gradle
  17. 3
      errorprone-checks/build.gradle
  18. 9
      ethereum/api/build.gradle
  19. 5
      ethereum/blockcreation/build.gradle
  20. 3
      ethereum/core/build.gradle
  21. 5
      ethereum/eth/build.gradle
  22. 27
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolPropagationTest.java
  23. 3
      ethereum/ethstats/build.gradle
  24. 3
      ethereum/evmtool/build.gradle
  25. 5
      ethereum/mock-p2p/build.gradle
  26. 5
      ethereum/p2p/build.gradle
  27. 149
      ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/TLSContextFactoryTest.java
  28. 4
      ethereum/permissioning/build.gradle
  29. 3
      ethereum/retesteth/build.gradle
  30. 3
      ethereum/rlp/build.gradle
  31. 5
      ethereum/stratum/build.gradle
  32. 3
      ethereum/trie/build.gradle
  33. 3
      evm/build.gradle
  34. 2
      gradle.properties
  35. 3
      gradle/versions.gradle
  36. 3
      metrics/core/build.gradle
  37. 3
      nat/build.gradle
  38. 3
      pki/build.gradle
  39. 9
      pki/src/test/java/org/hyperledger/besu/pki/keystore/HardwareKeyStoreFileWrapperTest.java
  40. 3
      plugins/rocksdb/build.gradle
  41. 3
      services/kvstore/build.gradle
  42. 3
      services/pipeline/build.gradle
  43. 3
      services/tasks/build.gradle
  44. 5
      util/build.gradle

@ -1,7 +1,11 @@
# Changelog # Changelog
## 22.1.4 ## 22.4.0-RC1
### Breaking Changes
### Additions and Improvements
- Unit tests are now executed with JUnit5 [#3620](https://github.com/hyperledger/besu/pull/3620)
## 22.1.3 ## 22.1.3

@ -11,8 +11,11 @@ dependencies {
implementation 'com.google.auto.service:auto-service' implementation 'com.google.auto.service:auto-service'
implementation 'info.picocli:picocli' implementation 'info.picocli:picocli'
testImplementation 'org.assertj:assertj-core'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
task testPluginsJar(type: Jar) { task testPluginsJar(type: Jar) {

@ -53,17 +53,17 @@ dependencies {
testImplementation 'io.grpc:grpc-core' testImplementation 'io.grpc:grpc-core'
testImplementation 'io.grpc:grpc-netty' testImplementation 'io.grpc:grpc-netty'
testImplementation 'io.grpc:grpc-stub' testImplementation 'io.grpc:grpc-stub'
testImplementation 'io.jaegertracing:jaeger-client'
testImplementation 'io.jaegertracing:jaeger-proto'
testImplementation 'io.netty:netty-all' testImplementation 'io.netty:netty-all'
testImplementation 'io.opentelemetry.proto:opentelemetry-proto'
testImplementation 'io.opentelemetry:opentelemetry-api' testImplementation 'io.opentelemetry:opentelemetry-api'
testImplementation 'io.opentelemetry:opentelemetry-exporter-otlp'
testImplementation 'io.opentelemetry:opentelemetry-sdk' testImplementation 'io.opentelemetry:opentelemetry-sdk'
testImplementation 'io.opentelemetry:opentelemetry-sdk-trace' testImplementation 'io.opentelemetry:opentelemetry-sdk-trace'
testImplementation 'io.opentelemetry:opentelemetry-exporter-otlp'
testImplementation 'io.opentelemetry.proto:opentelemetry-proto'
testImplementation 'io.opentracing.contrib:opentracing-okhttp3' testImplementation 'io.opentracing.contrib:opentracing-okhttp3'
testImplementation 'io.opentracing:opentracing-api' testImplementation 'io.opentracing:opentracing-api'
testImplementation 'io.opentracing:opentracing-util' testImplementation 'io.opentracing:opentracing-util'
testImplementation 'io.jaegertracing:jaeger-client'
testImplementation 'io.jaegertracing:jaeger-proto'
testImplementation 'io.vertx:vertx-core' testImplementation 'io.vertx:vertx-core'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.apache.commons:commons-compress' testImplementation 'org.apache.commons:commons-compress'
@ -71,10 +71,12 @@ dependencies {
testImplementation 'org.apache.tuweni:tuweni-crypto' testImplementation 'org.apache.tuweni:tuweni-crypto'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.web3j:abi' testImplementation 'org.web3j:abi'
testImplementation 'org.web3j:besu' testImplementation 'org.web3j:besu'
testImplementation 'org.testcontainers:testcontainers' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
test.enabled = false test.enabled = false

@ -84,16 +84,19 @@ dependencies {
testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts') testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'tech.pegasys.discovery:discovery'
testImplementation 'com.google.auto.service:auto-service' testImplementation 'com.google.auto.service:auto-service'
testImplementation 'com.squareup.okhttp3:okhttp' testImplementation 'com.squareup.okhttp3:okhttp'
testImplementation 'commons-io:commons-io'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.apache.commons:commons-text' testImplementation 'org.apache.commons:commons-text'
testImplementation 'org.apache.tuweni:tuweni-bytes' testImplementation 'org.apache.tuweni:tuweni-bytes'
testImplementation 'org.apache.tuweni:tuweni-units' testImplementation 'org.apache.tuweni:tuweni-units'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'commons-io:commons-io'
testImplementation 'org.testcontainers:testcontainers' testImplementation 'org.testcontainers:testcontainers'
testImplementation 'tech.pegasys.discovery:discovery'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -258,6 +258,7 @@ allprojects {
systemProperty name, System.getProperty(name) systemProperty name, System.getProperty(name)
} }
} }
useJUnitPlatform {}
} }
javadoc { javadoc {

@ -43,7 +43,10 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
configurations { testArtifacts } configurations { testArtifacts }

@ -58,5 +58,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -55,8 +55,11 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testSupportImplementation project( path: ':crypto', configuration: 'testSupportArtifacts') testSupportImplementation project( path: ':crypto', configuration: 'testSupportArtifacts')
testSupportImplementation project( path: ':ethereum:core', configuration: 'testSupportArtifacts') testSupportImplementation project( path: ':ethereum:core', configuration: 'testSupportArtifacts')

@ -69,7 +69,10 @@ dependencies {
integrationTestImplementation 'org.mockito:mockito-core' integrationTestImplementation 'org.mockito:mockito-core'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -44,5 +44,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -54,6 +54,9 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation project(':ethereum:core') testImplementation project(':ethereum:core')
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -80,10 +80,6 @@ dependencies {
integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts') integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts')
integrationTestImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') integrationTestImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts')
testImplementation 'junit:junit'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts') testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts')
testImplementation project(path: ':config', configuration: 'testSupportArtifacts') testImplementation project(path: ':config', configuration: 'testSupportArtifacts')
testImplementation project(path: ':consensus:common', configuration: 'testArtifacts') testImplementation project(path: ':consensus:common', configuration: 'testArtifacts')
@ -95,6 +91,14 @@ dependencies {
testImplementation project(':metrics:core') testImplementation project(':metrics:core')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
integrationTestImplementation project(':crypto') integrationTestImplementation project(':crypto')
integrationTestImplementation project(path: ':crypto', configuration: 'testSupportArtifacts') integrationTestImplementation project(path: ':crypto', configuration: 'testSupportArtifacts')
integrationTestImplementation project(path: ':consensus:common', configuration: 'testSupportArtifacts') integrationTestImplementation project(path: ':consensus:common', configuration: 'testSupportArtifacts')

@ -20,9 +20,12 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.testcontainers:testcontainers' testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.web3j:core' testImplementation 'org.web3j:core'
testImplementation 'org.web3j:quorum' testImplementation 'org.web3j:quorum'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
test.enabled = false test.enabled = false

@ -43,7 +43,10 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
artifacts { artifacts {

@ -40,6 +40,9 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
configurations { testArtifacts } configurations { testArtifacts }

@ -16,6 +16,9 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
// integration test dependencies. // integration test dependencies.
integrationTestImplementation project(':testutil') integrationTestImplementation project(':testutil')

@ -37,6 +37,9 @@ dependencies {
testImplementation 'com.google.errorprone:error_prone_test_helpers' testImplementation 'com.google.errorprone:error_prone_test_helpers'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
epJavac 'com.google.errorprone:error_prone_check_api' epJavac 'com.google.errorprone:error_prone_check_api'
} }

@ -88,14 +88,17 @@ dependencies {
testResourceGeneration project(':besu') testResourceGeneration project(':besu')
testImplementation 'com.squareup.okhttp3:okhttp' testImplementation 'com.squareup.okhttp3:okhttp'
testImplementation 'io.vertx:vertx-auth-jwt'
testImplementation 'io.vertx:vertx-unit' testImplementation 'io.vertx:vertx-unit'
testImplementation 'io.vertx:vertx-web-client'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.apache.logging.log4j:log4j-core' testImplementation 'org.apache.logging.log4j:log4j-core'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'io.vertx:vertx-web-client'
testImplementation 'io.vertx:vertx-auth-jwt' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testSupportImplementation 'org.bouncycastle:bcpkix-jdk15on' testSupportImplementation 'org.bouncycastle:bcpkix-jdk15on'
integrationTestImplementation project(':config') integrationTestImplementation project(':config')

@ -34,9 +34,12 @@ dependencies {
testImplementation project(':metrics:core') testImplementation project(':metrics:core')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -80,8 +80,11 @@ dependencies {
testImplementation 'org.apache.tuweni:tuweni-io' testImplementation 'org.apache.tuweni:tuweni-io'
testImplementation 'org.apache.tuweni:tuweni-units' testImplementation 'org.apache.tuweni:tuweni-units'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts') integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts')
integrationTestImplementation project(':testutil') integrationTestImplementation project(':testutil')

@ -71,11 +71,14 @@ dependencies {
testImplementation project(path: ':metrics:core', configuration: 'testSupportArtifacts') testImplementation project(path: ':metrics:core', configuration: 'testSupportArtifacts')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testSupportImplementation 'junit:junit' testSupportImplementation 'junit:junit'
testSupportImplementation 'org.mockito:mockito-core' testSupportImplementation 'org.mockito:mockito-core'

@ -14,6 +14,8 @@
*/ */
package org.hyperledger.besu.ethereum.eth.transactions; package org.hyperledger.besu.ethereum.eth.transactions;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.hyperledger.besu.crypto.KeyPair; import org.hyperledger.besu.crypto.KeyPair;
import org.hyperledger.besu.crypto.SignatureAlgorithm; import org.hyperledger.besu.crypto.SignatureAlgorithm;
import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory;
@ -27,24 +29,23 @@ import java.util.concurrent.TimeUnit;
import io.vertx.core.Vertx; import io.vertx.core.Vertx;
import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.bytes.Bytes32;
import org.awaitility.Awaitility; import org.awaitility.Awaitility;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.ComparisonFailure; import org.junit.jupiter.api.Test;
import org.junit.Test;
public class TransactionPoolPropagationTest { class TransactionPoolPropagationTest {
final DiscoveryConfiguration noDiscovery = DiscoveryConfiguration.create().setActive(false); final DiscoveryConfiguration noDiscovery = DiscoveryConfiguration.create().setActive(false);
private Vertx vertx; private Vertx vertx;
@Before @BeforeEach
public void setUp() { void setUp() {
vertx = Vertx.vertx(); vertx = Vertx.vertx();
} }
@After @AfterEach
public void tearDown() { void tearDown() {
vertx.close(); vertx.close();
} }
@ -67,8 +68,8 @@ public class TransactionPoolPropagationTest {
* 2nd order test to verify the framework correctly fails if a disconnect occurs It could have a * 2nd order test to verify the framework correctly fails if a disconnect occurs It could have a
* more detailed exception check - more than just the class. * more detailed exception check - more than just the class.
*/ */
@Test(expected = ComparisonFailure.class) @Test
public void disconnectShouldThrow() throws Exception { void disconnectShouldThrow() throws Exception {
try (final TestNodeList txNodes = new TestNodeList()) { try (final TestNodeList txNodes = new TestNodeList()) {
// Create & Start Nodes // Create & Start Nodes
@ -80,7 +81,7 @@ public class TransactionPoolPropagationTest {
node1.network.getPeers().iterator().next().disconnect(DisconnectReason.BREACH_OF_PROTOCOL); node1.network.getPeers().iterator().next().disconnect(DisconnectReason.BREACH_OF_PROTOCOL);
wrapup(txNodes); assertThatThrownBy(() -> wrapup(txNodes)).isInstanceOf(AssertionError.class);
} }
} }
@ -89,7 +90,7 @@ public class TransactionPoolPropagationTest {
* node. Verify that all nodes get the correct number of pending transactions. * node. Verify that all nodes get the correct number of pending transactions.
*/ */
@Test @Test
public void shouldPropagateLocalAndRemoteTransactions() throws Exception { void shouldPropagateLocalAndRemoteTransactions() throws Exception {
try (final TestNodeList nodes = new TestNodeList()) { try (final TestNodeList nodes = new TestNodeList()) {
// Create & Start Nodes // Create & Start Nodes
final TestNode node1 = nodes.create(vertx, null, null, noDiscovery); final TestNode node1 = nodes.create(vertx, null, null, noDiscovery);

@ -59,5 +59,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -62,7 +62,10 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
mainClassName = 'org.hyperledger.besu.evmtool.EvmTool' mainClassName = 'org.hyperledger.besu.evmtool.EvmTool'

@ -37,6 +37,9 @@ dependencies {
implementation 'io.vertx:vertx-core' implementation 'io.vertx:vertx-core'
implementation 'org.apache.tuweni:tuweni-bytes' implementation 'org.apache.tuweni:tuweni-bytes'
testImplementation "junit:junit" testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -66,6 +66,7 @@ dependencies {
testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts') testImplementation project(path: ':crypto', configuration: 'testSupportArtifacts')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation('io.pkts:pkts-core') { testImplementation('io.pkts:pkts-core') {
exclude group: 'io.pkts', module: 'pkts-sdp' exclude group: 'io.pkts', module: 'pkts-sdp'
exclude group: 'io.pkts', module: 'pkts-sip' exclude group: 'io.pkts', module: 'pkts-sip'
@ -75,6 +76,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -21,7 +21,6 @@ import org.hyperledger.besu.pki.keystore.HardwareKeyStoreWrapper;
import org.hyperledger.besu.pki.keystore.KeyStoreWrapper; import org.hyperledger.besu.pki.keystore.KeyStoreWrapper;
import org.hyperledger.besu.pki.keystore.SoftwareKeyStoreWrapper; import org.hyperledger.besu.pki.keystore.SoftwareKeyStoreWrapper;
import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Arrays; import java.util.Arrays;
@ -45,16 +44,16 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslHandler; import io.netty.handler.ssl.SslHandler;
import org.junit.After; import org.junit.Assume;
import org.junit.Before; import org.junit.jupiter.api.AfterEach;
import org.junit.Test; import org.junit.jupiter.api.BeforeEach;
import org.junit.runner.RunWith; import org.junit.jupiter.api.condition.OS;
import org.junit.runners.Parameterized; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@RunWith(Parameterized.class) class TLSContextFactoryTest {
public class TLSContextFactoryTest {
private static final String JKS = "JKS"; private static final String JKS = "JKS";
private static final String validKeystorePassword = "test123"; private static final String validKeystorePassword = "test123";
@ -86,19 +85,36 @@ public class TLSContextFactoryTest {
private Server server; private Server server;
private Client client; private Client client;
@Parameterized.Parameter public String keyStoreWrapperDescription; static Collection<Object[]> hardwareKeysData() {
return Arrays.asList(
@Parameterized.Parameter(1) new Object[][] {
public boolean testSuccess; {
"PKCS11 serverPartner1Client1 -> JKS clientPartner2Client1 SuccessfulConnection",
@Parameterized.Parameter(2) true,
public KeyStoreWrapper serverKeyStoreWrapper; getHardwareKeyStoreWrapper(partner1client1PKCS11Config, partner1client1CRL),
getSoftwareKeyStoreWrapper(
@Parameterized.Parameter(3) partner2client1JKSKeystore, partner2client1JKSTruststore, partner2client1CRL)
public KeyStoreWrapper clientKeyStoreWrapper; },
{
"PKCS11 serverPartner1Client1 -> JKS clientInvalidPartner1Client1 FailedConnection",
false,
getHardwareKeyStoreWrapper(partner1client1PKCS11Config, partner1client1CRL),
getSoftwareKeyStoreWrapper(
invalidPartner1client1JKSKeystore,
invalidPartner1client1JKSTruststore,
invalidPartner1client1CRL)
},
{
"PKCS11 serverPartner1Client1 -> JKS clientPartner1Client2rvk FailedConnection",
false,
getHardwareKeyStoreWrapper(partner1client1PKCS11Config, partner1client1CRL),
getSoftwareKeyStoreWrapper(
partner1client2rvkJKSKeystore, partner1client2rvkJKSTruststore, null)
},
});
}
@Parameterized.Parameters(name = "{index}: {0}") static Collection<Object[]> softwareKeysData() {
public static Collection<Object[]> data() {
return Arrays.asList( return Arrays.asList(
new Object[][] { new Object[][] {
{ {
@ -117,13 +133,6 @@ public class TLSContextFactoryTest {
getSoftwareKeyStoreWrapper( getSoftwareKeyStoreWrapper(
partner1client1JKSKeystore, partner1client1JKSTruststore, partner1client1CRL) partner1client1JKSKeystore, partner1client1JKSTruststore, partner1client1CRL)
}, },
{
"PKCS11 serverPartner1Client1 -> JKS clientPartner2Client1 SuccessfulConnection",
true,
getHardwareKeyStoreWrapper(partner1client1PKCS11Config, partner1client1CRL),
getSoftwareKeyStoreWrapper(
partner2client1JKSKeystore, partner2client1JKSTruststore, partner2client1CRL)
},
{ {
"JKS serverPartner1Client1 -> JKS clientInvalidPartner1Client1 FailedConnection", "JKS serverPartner1Client1 -> JKS clientInvalidPartner1Client1 FailedConnection",
false, false,
@ -144,15 +153,6 @@ public class TLSContextFactoryTest {
getSoftwareKeyStoreWrapper( getSoftwareKeyStoreWrapper(
partner1client1JKSKeystore, partner1client1JKSTruststore, partner1client1CRL) partner1client1JKSKeystore, partner1client1JKSTruststore, partner1client1CRL)
}, },
{
"PKCS11 serverPartner1Client1 -> JKS clientInvalidPartner1Client1 FailedConnection",
false,
getHardwareKeyStoreWrapper(partner1client1PKCS11Config, partner1client1CRL),
getSoftwareKeyStoreWrapper(
invalidPartner1client1JKSKeystore,
invalidPartner1client1JKSTruststore,
invalidPartner1client1CRL)
},
{ {
"JKS serverPartner1Client2rvk -> JKS clientPartner2Client1 FailedConnection", "JKS serverPartner1Client2rvk -> JKS clientPartner2Client1 FailedConnection",
false, false,
@ -169,13 +169,6 @@ public class TLSContextFactoryTest {
getSoftwareKeyStoreWrapper( getSoftwareKeyStoreWrapper(
partner1client2rvkJKSKeystore, partner1client2rvkJKSTruststore, null) partner1client2rvkJKSKeystore, partner1client2rvkJKSTruststore, null)
}, },
{
"PKCS11 serverPartner1Client1 -> JKS clientPartner1Client2rvk FailedConnection",
false,
getHardwareKeyStoreWrapper(partner1client1PKCS11Config, partner1client1CRL),
getSoftwareKeyStoreWrapper(
partner1client2rvkJKSKeystore, partner1client2rvkJKSTruststore, null)
},
{ {
"JKS serverPartner2Client2rvk -> JKS clientPartner1Client1 FailedConnection", "JKS serverPartner2Client2rvk -> JKS clientPartner1Client1 FailedConnection",
false, false,
@ -195,11 +188,11 @@ public class TLSContextFactoryTest {
}); });
} }
@Before @BeforeEach
public void init() throws IOException, InterruptedException {} void init() {}
@After @AfterEach
public void tearDown() { void tearDown() {
if (client != null) { if (client != null) {
client.stop(); client.stop();
} }
@ -217,7 +210,13 @@ public class TLSContextFactoryTest {
try { try {
return new HardwareKeyStoreWrapper( return new HardwareKeyStoreWrapper(
validKeystorePassword, toPath(config), toPath(crlLocation)); validKeystorePassword, toPath(config), toPath(crlLocation));
} catch (Exception e) { } catch (final Exception e) {
if (OS.MAC.isCurrentOs()) {
// nss3 is difficult to setup on mac correctly, don't let it break unit tests for dev
// machines.
Assume.assumeNoException("Failed to initialize hardware keystore", e);
}
// Not a mac, probably a production build. Full failure.
throw new PkiException("Failed to initialize hardware keystore", e); throw new PkiException("Failed to initialize hardware keystore", e);
} }
} }
@ -233,13 +232,38 @@ public class TLSContextFactoryTest {
toPath(trustStore), toPath(trustStore),
null, null,
toPath(crl)); toPath(crl));
} catch (Exception e) { } catch (final Exception e) {
throw new PkiException("Failed to initialize software keystore", e); throw new PkiException("Failed to initialize software keystore", e);
} }
} }
@Test @ParameterizedTest(name = "{index}: {0}")
public void testConnection() throws Exception { @MethodSource("softwareKeysData")
void testConnectionSoftwareKeys(
final String ignoredTestDescription,
final boolean testSuccess,
final KeyStoreWrapper serverKeyStoreWrapper,
final KeyStoreWrapper clientKeyStoreWrapper)
throws Exception {
testConnection(testSuccess, serverKeyStoreWrapper, clientKeyStoreWrapper);
}
@ParameterizedTest(name = "{index}: {0}")
@MethodSource("hardwareKeysData")
void testConnectionHardwareKeys(
final String ignoredTestDescription,
final boolean testSuccess,
final KeyStoreWrapper serverKeyStoreWrapper,
final KeyStoreWrapper clientKeyStoreWrapper)
throws Exception {
testConnection(testSuccess, serverKeyStoreWrapper, clientKeyStoreWrapper);
}
private void testConnection(
final boolean testSuccess,
final KeyStoreWrapper serverKeyStoreWrapper,
final KeyStoreWrapper clientKeyStoreWrapper)
throws Exception {
final CountDownLatch serverLatch = new CountDownLatch(MAX_NUMBER_MESSAGES); final CountDownLatch serverLatch = new CountDownLatch(MAX_NUMBER_MESSAGES);
final CountDownLatch clientLatch = new CountDownLatch(MAX_NUMBER_MESSAGES); final CountDownLatch clientLatch = new CountDownLatch(MAX_NUMBER_MESSAGES);
server = startServer(serverKeyStoreWrapper, serverLatch); server = startServer(serverKeyStoreWrapper, serverLatch);
@ -255,7 +279,7 @@ public class TLSContextFactoryTest {
client.getChannelFuture().channel().writeAndFlush(Unpooled.copyInt(0)).sync(); client.getChannelFuture().channel().writeAndFlush(Unpooled.copyInt(0)).sync();
serverLatch.await(2, TimeUnit.SECONDS); serverLatch.await(2, TimeUnit.SECONDS);
assertThat(client.getChannelFuture().channel().isActive()).isFalse(); assertThat(client.getChannelFuture().channel().isActive()).isFalse();
} catch (Exception e) { } catch (final Exception e) {
// NOOP // NOOP
} }
} }
@ -282,7 +306,7 @@ public class TLSContextFactoryTest {
private final String id; private final String id;
private final CountDownLatch latch; private final CountDownLatch latch;
public MessageHandler(final String id, final CountDownLatch latch) { MessageHandler(final String id, final CountDownLatch latch) {
this.id = id; this.id = id;
this.latch = latch; this.latch = latch;
} }
@ -312,7 +336,7 @@ public class TLSContextFactoryTest {
private ChannelFuture channelFuture; private ChannelFuture channelFuture;
private final EventLoopGroup group = new NioEventLoopGroup(); private final EventLoopGroup group = new NioEventLoopGroup();
public ChannelFuture getChannelFuture() { ChannelFuture getChannelFuture() {
return channelFuture; return channelFuture;
} }
@ -335,7 +359,7 @@ public class TLSContextFactoryTest {
new ChannelInitializer<SocketChannel>() { new ChannelInitializer<SocketChannel>() {
@Override @Override
protected void initChannel(final SocketChannel socketChannel) throws Exception { protected void initChannel(final SocketChannel socketChannel) throws Exception {
SslContext sslContext = final SslContext sslContext =
TLSContextFactory.getInstance(keystorePassword, keyStoreWrapper) TLSContextFactory.getInstance(keystorePassword, keyStoreWrapper)
.createNettyClientSslContext(); .createNettyClientSslContext();
@ -346,11 +370,10 @@ public class TLSContextFactoryTest {
} }
}); });
final ChannelFuture cf = b.connect("127.0.0.1", this.port).sync(); this.channelFuture = b.connect("127.0.0.1", this.port).sync();
this.channelFuture = cf;
} }
public void stop() { void stop() {
group.shutdownGracefully(); group.shutdownGracefully();
} }
} }
@ -362,7 +385,6 @@ public class TLSContextFactoryTest {
private final CountDownLatch latch; private final CountDownLatch latch;
private Channel channel; private Channel channel;
private ChannelFuture channelFuture;
private final EventLoopGroup parentGroup = new NioEventLoopGroup(); private final EventLoopGroup parentGroup = new NioEventLoopGroup();
private final EventLoopGroup childGroup = new NioEventLoopGroup(); private final EventLoopGroup childGroup = new NioEventLoopGroup();
@ -376,10 +398,6 @@ public class TLSContextFactoryTest {
this.latch = latch; this.latch = latch;
} }
public ChannelFuture getChannelFuture() {
return channelFuture;
}
void start() throws Exception { void start() throws Exception {
final ServerBootstrap sb = new ServerBootstrap(); final ServerBootstrap sb = new ServerBootstrap();
sb.group(parentGroup, childGroup) sb.group(parentGroup, childGroup)
@ -388,7 +406,7 @@ public class TLSContextFactoryTest {
new ChannelInitializer<SocketChannel>() { new ChannelInitializer<SocketChannel>() {
@Override @Override
public void initChannel(final SocketChannel socketChannel) throws Exception { public void initChannel(final SocketChannel socketChannel) throws Exception {
SslContext sslContext = final SslContext sslContext =
TLSContextFactory.getInstance(keystorePassword, keyStoreWrapper) TLSContextFactory.getInstance(keystorePassword, keyStoreWrapper)
.createNettyServerSslContext(); .createNettyServerSslContext();
final SslHandler sslHandler = sslContext.newHandler(channel.alloc()); final SslHandler sslHandler = sslContext.newHandler(channel.alloc());
@ -400,11 +418,10 @@ public class TLSContextFactoryTest {
final ChannelFuture cf = sb.bind(0).sync(); final ChannelFuture cf = sb.bind(0).sync();
this.channel = cf.channel(); this.channel = cf.channel();
this.channelFuture = cf;
this.port = ((InetSocketAddress) channel.localAddress()).getPort(); this.port = ((InetSocketAddress) channel.localAddress()).getPort();
} }
public void stop() { void stop() {
childGroup.shutdownGracefully(); childGroup.shutdownGracefully();
parentGroup.shutdownGracefully(); parentGroup.shutdownGracefully();
} }

@ -49,8 +49,12 @@ dependencies {
testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts')
testImplementation project(':evm') testImplementation project(':evm')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'io.vertx:vertx-core' testImplementation 'io.vertx:vertx-core'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -52,5 +52,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -45,6 +45,9 @@ dependencies {
testImplementation 'com.fasterxml.jackson.core:jackson-databind' testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
test { test {

@ -44,11 +44,14 @@ dependencies {
implementation 'org.apache.tuweni:tuweni-bytes' implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units' implementation 'org.apache.tuweni:tuweni-units'
testImplementation project(path: ':metrics:core', configuration: 'testSupportArtifacts')
testImplementation project(':testutil') testImplementation project(':testutil')
testImplementation 'com.fasterxml.jackson.core:jackson-databind' testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testImplementation project(path: ':metrics:core', configuration: 'testSupportArtifacts')
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -47,7 +47,10 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.apache.tuweni:tuweni-units' testImplementation 'org.apache.tuweni:tuweni-units'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
test { exclude 'org/hyperledger/besu/ethereum/trie/TrieRefTest.class' } test { exclude 'org/hyperledger/besu/ethereum/trie/TrieRefTest.class' }

@ -46,7 +46,10 @@ dependencies {
testImplementation 'info.picocli:picocli' testImplementation 'info.picocli:picocli'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
publishing { publishing {

@ -1,4 +1,4 @@
version=22.1.4-SNAPSHOT version=22.4.0-RC1
# Workaround for Java 16 and spotless bug 834 https://github.com/diffplug/spotless/issues/834 # Workaround for Java 16 and spotless bug 834 https://github.com/diffplug/spotless/issues/834
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \

@ -154,6 +154,9 @@ dependencyManagement {
dependency 'org.jupnp:org.jupnp.support:2.6.0' dependency 'org.jupnp:org.jupnp.support:2.6.0'
dependency 'org.jupnp:org.jupnp:2.6.0' dependency 'org.jupnp:org.jupnp:2.6.0'
dependency 'org.junit.jupiter:junit-jupiter:5.8.2'
dependency 'org.junit.vintage:junit-vintage-engine:5.8.2'
dependency 'org.mockito:mockito-core:4.4.0' dependency 'org.mockito:mockito-core:4.4.0'
dependency 'org.openjdk.jmh:jmh-core:1.34' dependency 'org.openjdk.jmh:jmh-core:1.34'

@ -66,8 +66,11 @@ dependencies {
testImplementation 'com.squareup.okhttp3:okhttp' testImplementation 'com.squareup.okhttp3:okhttp'
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testSupportImplementation 'org.mockito:mockito-core' testSupportImplementation 'org.mockito:mockito-core'
} }

@ -43,5 +43,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -36,7 +36,10 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }
configurations { testArtifacts } configurations { testArtifacts }

@ -27,6 +27,7 @@ import java.util.stream.Stream;
import org.junit.Assume; import org.junit.Assume;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.jupiter.api.condition.OS;
import org.junit.runners.Parameterized; import org.junit.runners.Parameterized;
public class HardwareKeyStoreFileWrapperTest extends BaseKeyStoreFileWrapperTest { public class HardwareKeyStoreFileWrapperTest extends BaseKeyStoreFileWrapperTest {
@ -60,7 +61,13 @@ public class HardwareKeyStoreFileWrapperTest extends BaseKeyStoreFileWrapperTest
.map(provider -> new HardwareKeyStoreWrapper(validKeystorePassword, provider, crlPath)) .map(provider -> new HardwareKeyStoreWrapper(validKeystorePassword, provider, crlPath))
.orElseGet(() -> new HardwareKeyStoreWrapper(validKeystorePassword, path, crlPath)); .orElseGet(() -> new HardwareKeyStoreWrapper(validKeystorePassword, path, crlPath));
} catch (final Exception e) { } catch (final Exception e) {
throw new PkiException("Failed to initialize NSS keystore", e); if (OS.MAC.isCurrentOs()) {
// nss3 is difficult to setup on mac correctly, don't let it break unit tests for dev
// machines.
Assume.assumeNoException("Failed to initialize hardware keystore", e);
}
// Not a mac, probably a production build. Full failure.
throw new PkiException("Failed to initialize hardware keystore", e);
} }
} }

@ -51,5 +51,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -44,5 +44,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -40,5 +40,8 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility' testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -42,4 +42,7 @@ dependencies {
testImplementation 'junit:junit' testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

@ -40,8 +40,11 @@ dependencies {
implementation 'org.apache.tuweni:tuweni-units' implementation 'org.apache.tuweni:tuweni-units'
implementation 'org.xerial.snappy:snappy-java' implementation 'org.xerial.snappy:snappy-java'
testImplementation 'junit:junit'
testImplementation 'io.vertx:vertx-unit' testImplementation 'io.vertx:vertx-unit'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core' testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
} }

Loading…
Cancel
Save