mirror of
https://github.com/corda/corda.git
synced 2025-03-14 00:06:45 +00:00
Fixed some compilation errors.
This commit is contained in:
parent
de0c69a888
commit
0b753969ee
@ -16,7 +16,6 @@ import com.nhaarman.mockito_kotlin.verify
|
||||
import com.nhaarman.mockito_kotlin.whenever
|
||||
import net.corda.node.internal.configureDatabase
|
||||
import net.corda.nodeapi.internal.persistence.CordaPersistence
|
||||
import net.corda.testing.internal.rigorousMock
|
||||
import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties
|
||||
import net.corda.testing.node.internal.makeTestDatabaseProperties
|
||||
import org.junit.After
|
||||
@ -49,7 +48,7 @@ class RunOnceServiceTest {
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
database = configureDatabase(makeTestDataSourceProperties(), makeTestDatabaseProperties(), rigorousMock())
|
||||
database = configureDatabase(makeTestDataSourceProperties(), makeTestDatabaseProperties(), { null }, { null })
|
||||
runOnceServiceMachine1 = RunOnceService(database, "machine1", "123", 1, 2, mockUpdateExecutor)
|
||||
runOnceServiceMachine2 = RunOnceService(database, "machine2", "789", 1, 2, mockUpdateExecutor)
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import net.corda.node.services.schema.NodeSchemaService
|
||||
import net.corda.nodeapi.internal.persistence.CordaPersistence
|
||||
import net.corda.nodeapi.internal.persistence.DatabaseConfig
|
||||
import net.corda.nodeapi.internal.persistence.SchemaMigration
|
||||
import net.corda.testing.internal.rigorousMock
|
||||
import net.corda.testing.node.MockServices
|
||||
import org.apache.commons.io.FileUtils
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
@ -44,14 +43,14 @@ class SchemaMigrationTest {
|
||||
@Test
|
||||
fun `Migration is run when runMigration is disabled, and database is H2`() {
|
||||
val dataSourceProps = MockServices.makeTestDataSourceProperties()
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = false), rigorousMock())
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = false), { null }, { null })
|
||||
checkMigrationRun(db)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Migration is run when runMigration is enabled`() {
|
||||
val dataSourceProps = MockServices.makeTestDataSourceProperties()
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = true), rigorousMock())
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = true), { null }, { null })
|
||||
checkMigrationRun(db)
|
||||
}
|
||||
|
||||
@ -65,7 +64,7 @@ class SchemaMigrationTest {
|
||||
migration.runMigration()
|
||||
|
||||
//start the node with "runMigration = false" and check that it started correctly
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = false), rigorousMock(), schemaService)
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = false), { null }, { null }, schemaService)
|
||||
checkMigrationRun(db)
|
||||
}
|
||||
|
||||
@ -79,7 +78,7 @@ class SchemaMigrationTest {
|
||||
addToClassPath(tmpFolder)
|
||||
|
||||
// run the migrations for DummyTestSchemaV1, which should pick up the migration file
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = true), rigorousMock(), NodeSchemaService(extraSchemas = setOf(DummyTestSchemaV1)))
|
||||
val db = configureDatabase(dataSourceProps, DatabaseConfig(runMigration = true), { null }, { null }, NodeSchemaService(extraSchemas = setOf(DummyTestSchemaV1)))
|
||||
|
||||
// check that the file was picked up
|
||||
val nrOfChangesOnDiscoveredFile = db.dataSource.connection.use {
|
||||
|
Loading…
x
Reference in New Issue
Block a user