corda / net.corda.testing.node / StartedMockNode

StartedMockNode

class StartedMockNode

A class that represents a started mock node for testing.

Properties

id

val id: Int

An identifier for the node. By default this is allocated sequentially in a MockNetwork.

info

val info: <ERROR CLASS>

The NodeInfo for the underlying node.

services

val services: <ERROR CLASS>

The ServiceHub for the underlying node.

Functions

findStateMachines

fun <F> findStateMachines(flowClass: Class<F>): List<<ERROR CLASS><F, <ERROR CLASS><out <ERROR CLASS>>>>

Returns the currently live flows of type flowClass, and their corresponding result future.

pumpReceive

fun pumpReceive(block: Boolean = false): MessageTransfer?

Delivers a single message from the internal queue. If there are no messages waiting to be delivered and block is true, waits until one has been provided on a different thread via send. If block is false, the return result indicates whether a message was delivered or not.

registerInitiatedFlow

fun <F> registerInitiatedFlow(initiatedFlowClass: Class<F>): <ERROR CLASS><F>

Manually register an initiating-responder flow pair based on the FlowLogic annotations.

fun <F> registerInitiatedFlow(initiatingFlowClass: Class<out <ERROR CLASS><out <ERROR CLASS>>>, initiatedFlowClass: Class<F>): <ERROR CLASS><F>

Register a custom relationship between initiating and receiving flow on a node-by-node basis. This is used when we want to manually specify that a particular initiating flow class will have a particular responder.

startFlow

fun <T> startFlow(logic: <ERROR CLASS><T>): <ERROR CLASS><T>

Starts an already constructed flow. Note that you must be on the server thread to call this method.

stop

fun stop(): <ERROR CLASS>

Stop the node.

transaction

fun <T> transaction(statement: () -> T): T

Executes given statement in the scope of transaction.