Clean up cash tests

Clean up cash tests ahead of anonymisation work. This simplifies some boiler plate setup/teardown
and ensures idenities and flows are correctly registered.
This commit is contained in:
Ross Nicoll
2017-06-06 17:09:32 +01:00
committed by GitHub
parent 6f43811f60
commit 35b0ceac0b
6 changed files with 54 additions and 60 deletions

View File

@ -6,6 +6,7 @@ import com.google.common.util.concurrent.Futures
import com.google.common.util.concurrent.ListenableFuture
import net.corda.core.*
import net.corda.core.crypto.entropyToKeyPair
import net.corda.flows.TxKeyFlow
import net.corda.core.identity.PartyAndCertificate
import net.corda.core.messaging.RPCOps
import net.corda.core.messaging.SingleMessageRecipient
@ -287,6 +288,8 @@ class MockNetwork(private val networkSendManuallyPumped: Boolean = false,
val node = nodeFactory.create(config, this, networkMapAddress, advertisedServices.toSet(), id, overrideServices, entropyRoot)
if (start) {
node.setup().start()
// Register flows that are normally found via plugins
node.registerInitiatedFlow(TxKeyFlow.Provider::class.java)
if (threadPerNode && networkMapAddress != null)
node.networkMapRegistrationFuture.getOrThrow() // Block and wait for the node to register in the net map.
}