Close DB after test

Add unique node prefix to DB source
This commit is contained in:
Maksymilian Pawlak 2018-05-01 14:37:35 +01:00
parent 597a15a230
commit 29615f512e
2 changed files with 6 additions and 1 deletions

View File

@ -122,6 +122,11 @@ open class VaultQueryTests {
services.identityService.verifyAndRegisterIdentity(identity)
}
}
@AfterClass @JvmStatic
fun afterClass() {
database.close()
}
}
private lateinit var transaction: DatabaseTransaction

View File

@ -117,7 +117,7 @@ open class MockServices private constructor(
networkParameters: NetworkParameters = testNetworkParameters(),
vararg moreKeys: KeyPair): Pair<CordaPersistence, MockServices> {
val cordappLoader = CordappLoader.createWithTestPackages(cordappPackages)
val dataSourceProps = makeTestDataSourceProperties(initialIdentity.name.organisation)
val dataSourceProps = makeTestDataSourceProperties(initialIdentity.name.organisation, SecureHash.randomSHA256().toString())
val schemaService = NodeSchemaService(cordappLoader.cordappSchemas)
val database = configureDatabase(dataSourceProps, makeTestDatabaseProperties(initialIdentity.name.organisation), identityService, schemaService)
val mockService = database.transaction {