corda / net.corda.testing.node / TestCordapp

TestCordapp

@DoNotImplement abstract class TestCordapp

Encapsulates a CorDapp that exists on the current classpath, which can be pulled in for testing. Use TestCordapp.findCordapp to locate an existing CorDapp.

This is a replacement API to DriverParameters.extraCordappPackagesToScan and MockNetwork.cordappPackages as they create custom jars which do not preserve any CorDapp metadata.

See Also

DriverParameters.cordappsForAllNodes

NodeParameters.additionalCordapps

MockNetworkParameters.cordappsForAllNodes

MockNodeParameters.additionalCordapps

Constructors

<init>

TestCordapp()

Encapsulates a CorDapp that exists on the current classpath, which can be pulled in for testing. Use TestCordapp.findCordapp to locate an existing CorDapp.

Properties

config

abstract val config: Map<String, Any>

Returns the config for on this CorDapp, defaults to empty if not specified.

Functions

withConfig

abstract fun withConfig(config: Map<String, Any>): TestCordapp

Returns a copy of this TestCordapp but with the specified CorDapp config.

Companion Object Functions

findCordapp

fun findCordapp(scanPackage: String): TestCordapp

Scans the current classpath to find the CorDapp that contains the given package. All the CorDapp's metdata present in its MANIFEST are inherited. If more than one location containing the package is found then an exception is thrown. An exception is also thrown if no CorDapp is found.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

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