mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Improved support for testing custom schemas using a MockNetwork. (#1450)
* Improved support for testing custom schemas using a MockNetwork. * Removed `requiredSchemas` from CordaPluginREgistry configuration Custom schema registration now uses classpath scanning (CorDapps) and explicit registration (tests) following same mechanisms as flow registration. * Updated following PR review feedback. * Helper function to return Kotlin object instance fixed and moved to core InternalUtils class. * Fixed auto-scanning Unit test to assert correct registration of custom schema. * cleanup comment. * Changes following rebase from master.
This commit is contained in:
@ -7,6 +7,8 @@ import net.corda.core.utilities.millis
|
||||
import net.corda.finance.DOLLARS
|
||||
import net.corda.finance.flows.CashIssueFlow
|
||||
import net.corda.finance.flows.CashPaymentFlow
|
||||
import net.corda.finance.schemas.CashSchemaV1
|
||||
import net.corda.finance.schemas.CommercialPaperSchemaV1
|
||||
import net.corda.node.services.FlowPermissions.Companion.startFlowPermission
|
||||
import net.corda.node.services.transactions.SimpleNotaryService
|
||||
import net.corda.nodeapi.User
|
||||
@ -38,6 +40,8 @@ class TraderDemoTest : NodeBasedTest() {
|
||||
val (nodeA, nodeB, bankNode) = listOf(nodeAFuture, nodeBFuture, bankNodeFuture, notaryFuture).map { it.getOrThrow() }
|
||||
|
||||
nodeA.registerInitiatedFlow(BuyerFlow::class.java)
|
||||
nodeA.registerCustomSchemas(setOf(CashSchemaV1))
|
||||
nodeB.registerCustomSchemas(setOf(CashSchemaV1, CommercialPaperSchemaV1))
|
||||
|
||||
val (nodeARpc, nodeBRpc) = listOf(nodeA, nodeB).map {
|
||||
val client = CordaRPCClient(it.configuration.rpcAddress!!, initialiseSerialization = false)
|
||||
|
Reference in New Issue
Block a user