CORDA-2333: Dependency update pass for tests and demos (#5211)

This commit is contained in:
Shams Asari 2019-06-13 10:15:13 +01:00 committed by GitHub
parent 8480d49e7e
commit 2152961d46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 75 additions and 72 deletions

View File

@ -44,9 +44,10 @@ buildscript {
ext.artemis_version = '2.6.2'
// upgrade Jackson only when corda is using kotlin 1.3.10
ext.jackson_version = '2.9.5'
ext.jetty_version = '9.4.7.v20170914'
ext.jersey_version = '2.25'
ext.assertj_version = '3.8.0'
ext.jetty_version = '9.4.18.v20190429'
ext.jersey_version = '2.28'
ext.servlet_version = '4.0.1'
ext.assertj_version = '3.12.2'
ext.slf4j_version = '1.7.25'
ext.log4j_version = '2.9.1'
ext.bouncycastle_version = constants.getProperty("bouncycastleVersion")
@ -58,18 +59,18 @@ buildscript {
ext.okhttp_version = '3.14.1'
ext.netty_version = '4.1.22.Final'
ext.typesafe_config_version = constants.getProperty("typesafeConfigVersion")
ext.fileupload_version = '1.3.3'
ext.fileupload_version = '1.4'
// Legacy JUnit 4 version
ext.junit_version = '4.12'
// Need this version to access classpath scanning error handling fix -
// see https://github.com/junit-team/junit5/commit/389de48c2a18c5a93a7203ef424aa47a8a835a74
// Upgrade to 5.5.x when GA release is available.
ext.junit_vintage_version = '5.5.0-M1'
ext.junit_jupiter_version = '5.5.0-M1'
ext.junit_platform_version = '1.4.2'
ext.mockito_version = '2.18.3'
ext.mockito_kotlin_version = '1.5.0'
ext.hamkrest_version = '1.4.2.2'
ext.junit_vintage_version = '5.5.0-RC1'
ext.junit_jupiter_version = '5.5.0-RC1'
ext.junit_platform_version = '1.5.0-RC1'
ext.mockito_version = '2.28.2'
ext.mockito_kotlin_version = '1.6.0'
ext.hamkrest_version = '1.7.0.0'
ext.jopt_simple_version = '5.0.2'
ext.jansi_version = '1.14'
ext.hibernate_version = '5.3.10.Final'
@ -89,8 +90,8 @@ buildscript {
ext.liquibase_version = '3.5.5'
ext.artifactory_contextUrl = 'https://ci-artifactory.corda.r3cev.com/artifactory'
ext.snake_yaml_version = constants.getProperty('snakeYamlVersion')
ext.docker_compose_rule_version = '0.33.0'
ext.selenium_version = '3.8.1'
ext.docker_compose_rule_version = '0.35.0'
ext.selenium_version = '3.141.59'
ext.ghostdriver_version = '2.1.0'
ext.eaagentloader_version = '1.0.3'
ext.proguard_version = constants.getProperty('proguardVersion')

View File

@ -697,7 +697,7 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
}
private fun JsonNode.assertHasOnlyFields(vararg fieldNames: String): List<JsonNode> {
assertThat(fieldNames()).containsOnly(*fieldNames)
assertThat(fieldNames()).toIterable().containsOnly(*fieldNames)
return fieldNames.map { this[it] }
}

View File

@ -3,7 +3,7 @@ package net.corda.confidential
import co.paralleluniverse.fibers.Suspendable
import com.natpryce.hamkrest.MatchResult
import com.natpryce.hamkrest.Matcher
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import com.natpryce.hamkrest.equalTo
import net.corda.core.crypto.DigitalSignature
import net.corda.core.flows.FlowLogic
@ -18,7 +18,10 @@ import net.corda.testing.core.*
import net.corda.testing.internal.matchers.allOf
import net.corda.testing.internal.matchers.flow.willReturn
import net.corda.testing.internal.matchers.hasOnlyEntries
import net.corda.testing.node.internal.*
import net.corda.testing.node.internal.InternalMockNetwork
import net.corda.testing.node.internal.TestStartedNode
import net.corda.testing.node.internal.enclosedCordapp
import net.corda.testing.node.internal.startFlow
import org.assertj.core.api.Assertions.assertThatThrownBy
import org.junit.AfterClass
import org.junit.Test
@ -45,7 +48,7 @@ class SwapIdentitiesFlowTests {
@Test
fun `issue key`() {
assert.that(
assertThat(
aliceNode.services.startFlow(SwapIdentitiesInitiator(bob)),
willReturn(
hasOnlyEntries(

View File

@ -2,7 +2,7 @@ package net.corda.core.flows
import co.paralleluniverse.fibers.Suspendable
import com.natpryce.hamkrest.*
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import net.corda.core.contracts.Attachment
import net.corda.core.crypto.SecureHash
import net.corda.core.flows.mixins.WithMockNet
@ -48,18 +48,18 @@ class AttachmentTests : WithMockNet {
val id = aliceNode.importAttachment(fakeAttachment("file1.txt", "Some useful content"))
// Get node one to run a flow to fetch it and insert it.
assert.that(
assertThat(
bobNode.startAttachmentFlow(id, alice),
willReturn(noAttachments()))
// Verify it was inserted into node one's store.
val attachment = bobNode.getAttachmentWithId(id)
assert.that(attachment, hashesTo(id))
assertThat(attachment, hashesTo(id))
// Shut down node zero and ensure node one can still resolve the attachment.
aliceNode.dispose()
assert.that(
assertThat(
bobNode.startAttachmentFlow(id, alice),
willReturn(soleAttachment(attachment)))
}
@ -69,7 +69,7 @@ class AttachmentTests : WithMockNet {
val hash: SecureHash = SecureHash.randomSHA256()
// Get node one to fetch a non-existent attachment.
assert.that(
assertThat(
bobNode.startAttachmentFlow(hash, alice),
willThrow(withRequestedHash(hash)))
}
@ -97,7 +97,7 @@ class AttachmentTests : WithMockNet {
badAliceNode.updateAttachment(corruptAttachment)
// Get n1 to fetch the attachment. Should receive corrupted bytes.
assert.that(
assertThat(
bobNode.startAttachmentFlow(id, badAlice),
willThrow<FetchDataFlow.DownloadedVsRequestedDataMismatch>()
)

View File

@ -1,7 +1,7 @@
package net.corda.core.flows
import co.paralleluniverse.fibers.Suspendable
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import net.corda.core.contracts.Command
import net.corda.core.contracts.StateAndContract
import net.corda.core.contracts.requireThat
@ -54,7 +54,7 @@ class CollectSignaturesFlowTests : WithContracts {
val bConfidentialIdentity = bobNode.createConfidentialIdentity(bob)
aliceNode.verifyAndRegister(bConfidentialIdentity)
assert.that(
assertThat(
aliceNode.startTestFlow(alice, bConfidentialIdentity.party, charlie),
willReturn(requiredSignatures(3))
)
@ -64,7 +64,7 @@ class CollectSignaturesFlowTests : WithContracts {
fun `no need to collect any signatures`() {
val ptx = aliceNode.signDummyContract(alice.ref(1))
assert.that(
assertThat(
aliceNode.collectSignatures(ptx),
willReturn(requiredSignatures(1))
)
@ -74,7 +74,7 @@ class CollectSignaturesFlowTests : WithContracts {
fun `fails when not signed by initiator`() {
val ptx = miniCorpServices.signDummyContract(alice.ref(1))
assert.that(
assertThat(
aliceNode.collectSignatures(ptx),
willThrow(errorMessage("The Initiator of CollectSignaturesFlow must have signed the transaction.")))
}
@ -88,7 +88,7 @@ class CollectSignaturesFlowTests : WithContracts {
bob.ref(3))
val signedByBoth = bobNode.addSignatureTo(signedByA)
assert.that(
assertThat(
aliceNode.collectSignatures(signedByBoth),
willReturn(requiredSignatures(2))
)

View File

@ -2,7 +2,7 @@ package net.corda.core.flows
import com.natpryce.hamkrest.and
import com.natpryce.hamkrest.anything
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import com.natpryce.hamkrest.has
import com.natpryce.hamkrest.isA
import net.corda.core.CordaRuntimeException
@ -52,30 +52,30 @@ class ContractUpgradeFlowRPCTest : WithContracts, WithFinality {
// Create, sign and finalise dummy contract.
val signedByA = aliceNode.signDummyContract(alice.ref(1), 0, bob.ref(1))
val stx = bobNode.addSignatureTo(signedByA)
assert.that(rpcA.finalise(stx, bob), willReturn())
assertThat(rpcA.finalise(stx, bob), willReturn())
val atx = aliceNode.getValidatedTransaction(stx)
val btx = bobNode.getValidatedTransaction(stx)
// Cannot upgrade contract without prior authorisation from counterparty
assert.that(
assertThat(
rpcA.initiateDummyContractUpgrade(atx),
willThrow<CordaRuntimeException>())
// Party B authorises the contract state upgrade, and immediately deauthorises the same.
assert.that(rpcB.authoriseDummyContractUpgrade(btx), willReturn())
assert.that(rpcB.deauthoriseContractUpgrade(btx), willReturn())
assertThat(rpcB.authoriseDummyContractUpgrade(btx), willReturn())
assertThat(rpcB.deauthoriseContractUpgrade(btx), willReturn())
// Cannot upgrade contract if counterparty has deauthorised a previously-given authority
assert.that(
assertThat(
rpcA.initiateDummyContractUpgrade(atx),
willThrow<CordaRuntimeException>())
// Party B authorise the contract state upgrade.
assert.that(rpcB.authoriseDummyContractUpgrade(btx), willReturn())
assertThat(rpcB.authoriseDummyContractUpgrade(btx), willReturn())
// Party A initiates contract upgrade flow, expected to succeed this time.
assert.that(
assertThat(
rpcA.initiateDummyContractUpgrade(atx),
willReturn(
aliceNode.hasDummyContractUpgradeTransaction()

View File

@ -1,7 +1,7 @@
package net.corda.core.flows
import com.natpryce.hamkrest.*
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import net.corda.core.contracts.*
import net.corda.core.flows.mixins.WithContracts
import net.corda.core.flows.mixins.WithFinality
@ -59,24 +59,24 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality {
val bobTx = bobNode.getValidatedTransaction(stx)
// The request is expected to be rejected because party B hasn't authorised the upgrade yet.
assert.that(
assertThat(
aliceNode.initiateContractUpgrade(aliceTx, DummyContractV2::class),
willThrow<UnexpectedFlowEndException>())
// Party B authorises the contract state upgrade, and immediately de-authorises the same.
assert.that(bobNode.authoriseContractUpgrade(bobTx, DummyContractV2::class), willReturn())
assert.that(bobNode.deauthoriseContractUpgrade(bobTx), willReturn())
assertThat(bobNode.authoriseContractUpgrade(bobTx, DummyContractV2::class), willReturn())
assertThat(bobNode.deauthoriseContractUpgrade(bobTx), willReturn())
// The request is expected to be rejected because party B has subsequently de-authorised a previously authorised upgrade.
assert.that(
assertThat(
aliceNode.initiateContractUpgrade(aliceTx, DummyContractV2::class),
willThrow<UnexpectedFlowEndException>())
// Party B authorises the contract state upgrade.
assert.that(bobNode.authoriseContractUpgrade(bobTx, DummyContractV2::class), willReturn())
assertThat(bobNode.authoriseContractUpgrade(bobTx, DummyContractV2::class), willReturn())
// Party A initiates contract upgrade flow, expected to succeed this time.
assert.that(
assertThat(
aliceNode.initiateContractUpgrade(aliceTx, DummyContractV2::class),
willReturn(
aliceNode.hasContractUpgradeTransaction<DummyContract.State, DummyContractV2.State>()
@ -86,10 +86,10 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality {
// We now test that the upgraded state can be upgraded further, to V3.
// Party B authorises the contract state upgrade.
assert.that(bobNode.authoriseContractUpgrade(upgradedState, DummyContractV3::class), willReturn())
assertThat(bobNode.authoriseContractUpgrade(upgradedState, DummyContractV3::class), willReturn())
// Party A initiates contract upgrade flow which is expected to succeed.
assert.that(
assertThat(
aliceNode.initiateContractUpgrade(upgradedState, DummyContractV3::class),
willReturn(
aliceNode.hasContractUpgradeTransaction<DummyContractV2.State, DummyContractV3.State>()
@ -125,14 +125,14 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality {
val stateAndRef = cashFlowResult.stx.tx.outRef<Cash.State>(0)
// The un-upgraded state is Cash.State
assert.that(aliceNode.getBaseStateFromVault(), hasContractState(isA<Cash.State>(anything)))
assertThat(aliceNode.getBaseStateFromVault(), hasContractState(isA<Cash.State>(anything)))
// Starts contract upgrade flow.
assert.that(aliceNode.initiateContractUpgrade(stateAndRef, CashV2::class), willReturn())
assertThat(aliceNode.initiateContractUpgrade(stateAndRef, CashV2::class), willReturn())
// Get contract state from the vault.
val upgradedState = aliceNode.getCashStateFromVault()
assert.that(upgradedState,
assertThat(upgradedState,
hasIssuedAmount(Amount(1000000, USD) `issued by` (alice.ref(1)))
and belongsTo(anonymisedRecipient))
@ -146,8 +146,8 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality {
addCommand(CashV2.Move(), alice.owningKey)
}
assert.that(aliceNode.finalise(spendUpgradedTx), willReturn())
assert.that(aliceNode.getCashStateFromVault(), hasContractState(equalTo(movedState)))
assertThat(aliceNode.finalise(spendUpgradedTx), willReturn())
assertThat(aliceNode.getCashStateFromVault(), hasContractState(equalTo(movedState)))
}
class CashV2 : UpgradedContractWithLegacyConstraint<Cash.State, CashV2.State> {

View File

@ -1,7 +1,7 @@
package net.corda.core.flows
import com.natpryce.hamkrest.and
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import net.corda.core.flows.mixins.WithFinality
import net.corda.core.flows.mixins.WithFinality.FinalityInvoker
import net.corda.core.identity.Party
@ -17,7 +17,6 @@ import net.corda.testing.internal.matchers.flow.willReturn
import net.corda.testing.internal.matchers.flow.willThrow
import net.corda.testing.node.internal.*
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.assertThatIllegalArgumentException
import org.junit.After
import org.junit.Test
@ -40,7 +39,7 @@ class FinalityFlowTests : WithFinality {
val bob = createBob()
val stx = aliceNode.issuesCashTo(bob)
assert.that(
assertThat(
aliceNode.finalise(stx, bob.info.singleIdentity()),
willReturn(
requiredSignatures(1)
@ -52,7 +51,7 @@ class FinalityFlowTests : WithFinality {
// Charlie isn't part of this network, so node A won't recognise them
val stx = aliceNode.issuesCashTo(CHARLIE)
assert.that(
assertThat(
aliceNode.finalise(stx),
willThrow<IllegalArgumentException>())
}

View File

@ -1,7 +1,7 @@
package net.corda.core.flows
import co.paralleluniverse.fibers.Suspendable
import com.natpryce.hamkrest.assertion.assert
import com.natpryce.hamkrest.assertion.assertThat
import net.corda.core.flows.mixins.WithMockNet
import net.corda.core.identity.Party
import net.corda.core.utilities.UntrustworthyData
@ -10,11 +10,10 @@ import net.corda.testing.core.singleIdentity
import net.corda.testing.internal.matchers.flow.willReturn
import net.corda.testing.node.internal.InternalMockNetwork
import net.corda.testing.node.internal.TestStartedNode
import org.assertj.core.api.Assertions.assertThat
import org.junit.AfterClass
import org.junit.Test
import kotlin.reflect.KClass
import kotlin.test.assertEquals
class ReceiveMultipleFlowTests : WithMockNet {
companion object {
@ -52,13 +51,13 @@ class ReceiveMultipleFlowTests : WithMockNet {
// this is a closure, meaning you can access variables outside its scope e.g., `answer`.
val receivedMessage = session.receive<String>().unwrap { it }
logger.info("Got message from counterParty: $receivedMessage.")
assertThat(receivedMessage).isEqualTo(message)
assertEquals(message, receivedMessage)
session.send(answer)
}
} as FlowLogic<Unit>
}
assert.that(
assertThat(
nodes[0].startFlowAndRunNetwork(initiatingFlow),
willReturn(answer as Any))
}
@ -70,7 +69,7 @@ class ReceiveMultipleFlowTests : WithMockNet {
val stringValue = "Thriller"
nodes[2].registerAnswer(AlgorithmDefinition::class, stringValue)
assert.that(
assertThat(
nodes[0].startFlowAndRunNetwork(ParallelAlgorithmMap(nodes[1].info.singleIdentity(), nodes[2].info.singleIdentity())),
willReturn(doubleValue * stringValue.length))
}
@ -82,7 +81,7 @@ class ReceiveMultipleFlowTests : WithMockNet {
val value2 = 6.0
nodes[2].registerAnswer(ParallelAlgorithmList::class, value2)
assert.that(
assertThat(
nodes[0].startFlowAndRunNetwork(ParallelAlgorithmList(nodes[1].info.singleIdentity(), nodes[2].info.singleIdentity())),
willReturn(listOf(value1, value2)))
}

View File

@ -186,7 +186,7 @@ dependencies {
// Web stuff: for HTTP[S] servlets
testCompile "org.eclipse.jetty:jetty-servlet:${jetty_version}"
testCompile "org.eclipse.jetty:jetty-webapp:${jetty_version}"
testCompile "javax.servlet:javax.servlet-api:3.1.0"
testCompile "javax.servlet:javax.servlet-api:${servlet_version}"
// Jersey for JAX-RS implementation for use in Jetty
testCompile "org.glassfish.jersey.core:jersey-server:${jersey_version}"

View File

@ -33,8 +33,8 @@ configurations {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
compile "javax.servlet:javax.servlet-api:3.1.0"
compile "javax.ws.rs:javax.ws.rs-api:2.0.1"
compile "javax.servlet:javax.servlet-api:${servlet_version}"
compile "javax.ws.rs:javax.ws.rs-api:2.1.1"
cordaCompile project(':client:rpc')
// Cordformation needs a SLF4J implementation when executing the Network

View File

@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE"
classpath "io.spring.gradle:dependency-management-plugin:1.0.7.RELEASE"
}
}
@ -61,7 +61,7 @@ repositories {
}
dependencies {
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile "commons-io:commons-io:$commons_io_version"
compile project(":samples:irs-demo:web")
compile('org.springframework.boot:spring-boot-starter-web') {
exclude module: "spring-boot-starter-logging"

View File

@ -23,7 +23,7 @@ dependencies {
// Cordapp dependencies
// Specify your cordapp's dependencies below, including dependent cordapps
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile "commons-io:commons-io:$commons_io_version"
testCompile project(':node-driver')

View File

@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.yaml:snakeyaml:1.19"
classpath "org.yaml:snakeyaml:1.24"
}
}

View File

@ -40,12 +40,13 @@ dependencies {
// Web stuff: for HTTP[S] servlets
compile "org.eclipse.jetty:jetty-servlet:${jetty_version}"
compile "org.eclipse.jetty:jetty-webapp:${jetty_version}"
compile "javax.servlet:javax.servlet-api:3.1.0"
compile "javax.servlet:javax.servlet-api:${servlet_version}"
compile "org.gradle:gradle-tooling-api:${gradle.gradleVersion}"
// Jersey for JAX-RS implementation for use in Jetty
compile "org.glassfish.jersey.core:jersey-server:${jersey_version}"
compile "org.glassfish.jersey.inject:jersey-hk2:${jersey_version}"
compile "org.glassfish.jersey.containers:jersey-container-servlet-core:${jersey_version}"
compile "org.glassfish.jersey.containers:jersey-container-jetty-http:${jersey_version}"
}

View File

@ -16,7 +16,7 @@ dependencies {
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}"
runtimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}"
compile 'org.hamcrest:hamcrest-library:1.3'
compile 'org.hamcrest:hamcrest-library:2.1'
compile "com.nhaarman:mockito-kotlin:$mockito_kotlin_version"
compile "org.mockito:mockito-core:$mockito_version"
compile "org.assertj:assertj-core:$assertj_version"

View File

@ -65,7 +65,7 @@ class ANSIProgressRendererTest {
private fun checkTrackingState(captor: KArgumentCaptor<Ansi>, updates: Int, trackerState: List<String>) {
verify(printWriter, times(updates)).print(captor.capture())
assertThat(captor.lastValue.toString()).containsSequence(trackerState)
assertThat(captor.lastValue.toString()).containsSubsequence(trackerState)
verify(printWriter, times(updates)).flush()
}

View File

@ -34,7 +34,7 @@ dependencies {
// Web stuff: for HTTP[S] servlets
compile "org.eclipse.jetty:jetty-servlet:$jetty_version"
compile "org.eclipse.jetty:jetty-webapp:$jetty_version"
compile "javax.servlet:javax.servlet-api:3.1.0"
compile "javax.servlet:javax.servlet-api:${servlet_version}"
compile "commons-fileupload:commons-fileupload:$fileupload_version"
// Log4J: logging framework (with SLF4J bindings)
@ -54,7 +54,7 @@ dependencies {
compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
// For rendering the index page.
compile "org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.3"
compile "org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.12"
// Capsule is a library for building independently executable fat JARs.
// We only need this dependency to compile our Caplet against.