mirror of
https://github.com/corda/corda.git
synced 2025-02-05 02:29:20 +00:00
Database integration tests - added NotaryService schema to database setup. (#328)
* Added NotaryService schema to database setup for two integration tests. * SQL Server setup scripts - create Login only if not preset (as it's done for Azure SQL).
This commit is contained in:
parent
c7487a8696
commit
1e2cc3e2df
@ -14,6 +14,7 @@ import net.corda.testing.common.internal.ProjectStructure.projectRootDir
|
||||
import net.corda.testing.driver.driver
|
||||
import net.corda.testing.internal.IntegrationTest
|
||||
import net.corda.testing.internal.IntegrationTestSchemas
|
||||
import net.corda.testing.internal.toDatabaseSchemaName
|
||||
import net.corda.testing.internal.toDatabaseSchemaNames
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.assertj.core.api.Assertions.assertThatThrownBy
|
||||
@ -27,7 +28,8 @@ class BootTests : IntegrationTest() {
|
||||
companion object {
|
||||
@ClassRule @JvmField
|
||||
val databaseSchemas = IntegrationTestSchemas(*listOf(ALICE_NAME, BOB_NAME, DUMMY_BANK_A_NAME)
|
||||
.map { it.toDatabaseSchemaNames("", "_10000", "_10003") }.flatten().toTypedArray())
|
||||
.map { it.toDatabaseSchemaNames("", "_10000", "_10003") }.flatten().toTypedArray()
|
||||
+ DUMMY_NOTARY_NAME.toDatabaseSchemaName())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -21,7 +21,8 @@ import org.junit.Test
|
||||
class CordappScanningDriverTest : IntegrationTest() {
|
||||
companion object {
|
||||
@ClassRule @JvmField
|
||||
val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName())
|
||||
val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(),
|
||||
DUMMY_NOTARY_NAME.toDatabaseSchemaName())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -52,7 +52,7 @@ DROP SEQUENCE IF EXISTS ${schema}.hibernate_sequence;
|
||||
DROP USER IF EXISTS ${schema};
|
||||
DROP LOGIN ${schema};
|
||||
DROP SCHEMA IF EXISTS ${schema};
|
||||
CREATE LOGIN ${schema} WITH PASSWORD = 'yourStrong(!)Password';
|
||||
IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'${schema}') CREATE LOGIN ${schema} WITH PASSWORD = 'yourStrong(!)Password';
|
||||
CREATE SCHEMA ${schema};
|
||||
CREATE USER ${schema} FOR LOGIN ${schema} WITH DEFAULT_SCHEMA = ${schema};
|
||||
GRANT ALTER, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, UPDATE, VIEW DEFINITION ON SCHEMA::${schema} TO ${schema};
|
||||
|
Loading…
x
Reference in New Issue
Block a user