@DoNotImplement public 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.
TestCordapp.findCordapp
public 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.
TestCordapp.findCordapp
@NotNull public java.util.Map<java.lang.String,java.lang.Object> getConfig()
Returns the config for on this CorDapp, defaults to empty if not specified.
@NotNull public TestCordapp withConfig(@NotNull java.util.Map<java.lang.String,? extends java.lang.Object> config)
Returns a copy of this class TestCordapp
but with the specified CorDapp config.
class TestCordapp
@JvmStatic @NotNull public static TestCordapp findCordapp(@NotNull java.lang.String scanPackage)
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.
scanPackage
- The package name used to find the CorDapp. This does not need to be the root package of the CorDapp.