public static class MockServices.Companion
Modifier and Type | Method and Description |
---|---|
java.util.Properties |
makeTestDataSourceProperties(java.lang.String nodeName)
Make properties appropriate for creating a DataSource for unit tests.
|
NonExistentClass |
makeTestDatabaseAndMockServices(java.util.List<java.lang.String> cordappPackages,
IdentityService identityService,
NonExistentClass initialIdentity,
NetworkParameters networkParameters,
java.security.KeyPair moreKeys)
Makes database and mock services appropriate for unit tests.
|
NonExistentClass |
makeTestDatabaseAndPersistentServices(java.util.List<java.lang.String> cordappPackages,
NonExistentClass initialIdentity,
NetworkParameters networkParameters,
java.util.Set<java.security.KeyPair> moreKeys,
java.util.Set<net.corda.core.identity.PartyAndCertificate> moreIdentities,
net.corda.testing.internal.TestingNamedCacheFactory cacheFactory)
Makes database and persistent services appropriate for unit tests which require persistence across the vault, identity service
and key managment service.
|
public java.util.Properties makeTestDataSourceProperties(java.lang.String nodeName)
Make properties appropriate for creating a DataSource for unit tests.
nodeName
- Reflects the "instance" of the in-memory database. Defaults to a random string.public NonExistentClass makeTestDatabaseAndMockServices(java.util.List<java.lang.String> cordappPackages, IdentityService identityService, NonExistentClass initialIdentity, NetworkParameters networkParameters, java.security.KeyPair moreKeys)
Makes database and mock services appropriate for unit tests.
cordappPackages
- A List of cordapp packages to scan for any cordapp code, e.g. contract verification code, flows and services.identityService
- An instance of interface IdentityService
, see MockServicesKt.makeTestIdentityService
.initialIdentity
- The first (typically sole) identity the services will represent.moreKeys
- A list of additional KeyPair instances to be used by class MockServices
.class MockServices
.public NonExistentClass makeTestDatabaseAndPersistentServices(java.util.List<java.lang.String> cordappPackages, NonExistentClass initialIdentity, NetworkParameters networkParameters, java.util.Set<java.security.KeyPair> moreKeys, java.util.Set<net.corda.core.identity.PartyAndCertificate> moreIdentities, net.corda.testing.internal.TestingNamedCacheFactory cacheFactory)
Makes database and persistent services appropriate for unit tests which require persistence across the vault, identity service and key managment service.
cordappPackages
- A List of cordapp packages to scan for any cordapp code, e.g. contract verification code,
flows and services.initialIdentity
- The first (typically sole) identity the services will represent.moreKeys
- A list of additional KeyPair instances to be used by class MockServices
.moreIdentities
- A list of additional KeyPair instances to be used by class MockServices
.cacheFactory
- A custom cache factory to be used by the created interface IdentityService
class MockServices
.