mirror of
https://github.com/corda/corda.git
synced 2025-01-14 08:49:47 +00:00
Add db integration to new tests (#180)
This commit is contained in:
parent
3dd524c6fd
commit
1fc200efa7
@ -8,15 +8,21 @@ import net.corda.core.utilities.getOrThrow
|
|||||||
import net.corda.node.services.config.configureDevKeyAndTrustStores
|
import net.corda.node.services.config.configureDevKeyAndTrustStores
|
||||||
import net.corda.nodeapi.internal.config.SSLConfiguration
|
import net.corda.nodeapi.internal.config.SSLConfiguration
|
||||||
import net.corda.nodeapi.internal.crypto.*
|
import net.corda.nodeapi.internal.crypto.*
|
||||||
import net.corda.testing.ALICE_NAME
|
import net.corda.testing.*
|
||||||
import net.corda.testing.driver.driver
|
import net.corda.testing.driver.driver
|
||||||
|
import org.junit.ClassRule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertFailsWith
|
import kotlin.test.assertFailsWith
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
class NodeKeystoreCheckTest {
|
class NodeKeystoreCheckTest : IntegrationTest() {
|
||||||
|
companion object {
|
||||||
|
@ClassRule @JvmField
|
||||||
|
val databaseSchemas = IntegrationTestSchemas(ALICE.toDatabaseSchemaName())
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `node should throw exception if cert path doesn't chain to the trust root`() {
|
fun `node should throw exception if cert path doesn't chain to the trust root`() {
|
||||||
driver(startNodesInProcess = true) {
|
driver(startNodesInProcess = true) {
|
||||||
|
@ -21,6 +21,7 @@ import net.corda.testing.*
|
|||||||
import org.apache.activemq.artemis.api.core.ActiveMQSecurityException
|
import org.apache.activemq.artemis.api.core.ActiveMQSecurityException
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
|
import org.junit.ClassRule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.sql.DriverManager
|
import java.sql.DriverManager
|
||||||
import java.sql.Statement
|
import java.sql.Statement
|
||||||
@ -28,6 +29,10 @@ import java.util.*
|
|||||||
import kotlin.test.assertFailsWith
|
import kotlin.test.assertFailsWith
|
||||||
|
|
||||||
abstract class UserAuthServiceTest : NodeBasedTest() {
|
abstract class UserAuthServiceTest : NodeBasedTest() {
|
||||||
|
companion object {
|
||||||
|
@ClassRule @JvmField
|
||||||
|
val databaseSchemas = IntegrationTestSchemas(ALICE.toDatabaseSchemaName())
|
||||||
|
}
|
||||||
|
|
||||||
protected lateinit var node: StartedNode<Node>
|
protected lateinit var node: StartedNode<Node>
|
||||||
protected lateinit var client: CordaRPCClient
|
protected lateinit var client: CordaRPCClient
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CREATE SCHEMA ${schema};
|
IF NOT EXISTS (SELECT schema_name FROM information_schema.schemata WHERE schema_name = '${schema}') EXEC('CREATE SCHEMA ${schema}');
|
||||||
CREATE USER ${schema} FOR LOGIN ${schema} WITH DEFAULT_SCHEMA = ${schema};
|
IF NOT EXISTS (SELECT * FROM sys.sysusers WHERE name='${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};
|
GRANT ALTER, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, UPDATE, VIEW DEFINITION ON SCHEMA::${schema} TO ${schema};
|
||||||
GRANT CREATE TABLE, CREATE PROCEDURE, CREATE FUNCTION, CREATE VIEW TO ${schema};
|
GRANT CREATE TABLE, CREATE PROCEDURE, CREATE FUNCTION, CREATE VIEW TO ${schema};
|
Loading…
Reference in New Issue
Block a user