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: NodeInfo

The NodeInfo for the underlying node.

services

val services: ServiceHub

The ServiceHub for the underlying node.

Functions

findStateMachines

fun <F : FlowLogic<*>> findStateMachines(flowClass: Class<F>): List<Pair<F, CordaFuture<*>>>

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 : FlowLogic<*>> registerInitiatedFlow(initiatedFlowClass: Class<F>): Observable<F>

Register a flow that is initiated by another flow .

startFlow

fun <T> startFlow(logic: FlowLogic<T>): CordaFuture<T>

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

stop

fun stop(): Unit

Stop the node.

transaction

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

Executes given statement in the scope of transaction.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.