mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
[ENT-1153] fix merge - revert feature for database integration test (Enterprise feature)
This commit is contained in:
parent
7d75d95dc2
commit
c32c21bc48
@ -47,8 +47,7 @@ data class DatabaseConfig(
|
||||
val initDatabase: Boolean = true,
|
||||
val serverNameTablePrefix: String = "",
|
||||
val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ,
|
||||
val schema: String? = null,
|
||||
val nodeOrganizationName: String? = null
|
||||
val schema: String? = null
|
||||
)
|
||||
|
||||
enum class TransactionIsolationLevel {
|
||||
|
@ -18,7 +18,6 @@ import net.corda.core.utilities.getOrThrow
|
||||
import net.corda.core.utilities.seconds
|
||||
import net.corda.node.services.api.StartedNodeServices
|
||||
import net.corda.node.services.config.CertChainPolicyConfig
|
||||
import net.corda.node.services.config.DatabaseConfig
|
||||
import net.corda.node.services.config.NodeConfiguration
|
||||
import net.corda.node.services.config.VerifierType
|
||||
import net.corda.nodeapi.User
|
||||
|
@ -27,7 +27,6 @@ import net.corda.node.internal.StartedNode
|
||||
import net.corda.node.internal.cordapp.CordappLoader
|
||||
import net.corda.node.services.api.SchemaService
|
||||
import net.corda.node.services.config.BFTSMaRtConfiguration
|
||||
import net.corda.node.services.config.DatabaseConfig
|
||||
import net.corda.node.services.config.NodeConfiguration
|
||||
import net.corda.node.services.config.NotaryConfig
|
||||
import net.corda.node.services.keys.E2ETestKeyManagementService
|
||||
|
@ -109,8 +109,10 @@ open class MockServices(
|
||||
* @param nodeName Reflects the "instance" of the in-memory database or database username/schema.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun makeTestDatabaseProperties(nodeName: String? = null): DatabaseConfig =
|
||||
DatabaseConfig(nodeOrganizationName = nodeName)
|
||||
fun makeTestDatabaseProperties(nodeName: String? = null): DatabaseConfig {
|
||||
val config = readDatabaseConfig(nodeName)
|
||||
return DatabaseConfig(schema = if (config.hasPath("database.schema")) config.getString("database.schema") else "")
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of [InMemoryIdentityService] with [MOCK_IDENTITIES].
|
||||
@ -145,7 +147,7 @@ open class MockServices(
|
||||
initialIdentityName: CordaX500Name): Pair<CordaPersistence, MockServices> {
|
||||
val cordappLoader = CordappLoader.createWithTestPackages(cordappPackages)
|
||||
val dataSourceProps = makeTestDataSourceProperties()
|
||||
val database = configureDatabase(dataSourceProps, DatabaseConfig(), identityService, NodeSchemaService(cordappLoader))
|
||||
val database = configureDatabase(dataSourceProps, makeTestDatabaseProperties(), identityService, NodeSchemaService(cordappLoader))
|
||||
val mockService = database.transaction {
|
||||
object : MockServices(cordappLoader, initialIdentityName = initialIdentityName, keys = *(keys.toTypedArray())) {
|
||||
override val identityService get() = identityService
|
||||
|
Loading…
x
Reference in New Issue
Block a user