mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Add DbManagement tests for Oracle (#2186)
This commit is contained in:
parent
ddea46545f
commit
f628c265ae
@ -101,7 +101,7 @@ class DbManagementTest extends BitcoinSAsyncTest with EmbeddedPg {
|
||||
val expected = 2
|
||||
assert(result == expected)
|
||||
val flywayInfo = nodeDbManagement.info()
|
||||
//+1 for << Flyway Schema Creation >>
|
||||
|
||||
assert(flywayInfo.applied().length == expected)
|
||||
assert(flywayInfo.pending().length == 0)
|
||||
case PostgreSQL =>
|
||||
@ -114,4 +114,28 @@ class DbManagementTest extends BitcoinSAsyncTest with EmbeddedPg {
|
||||
assert(flywayInfo.pending().length == 0)
|
||||
}
|
||||
}
|
||||
|
||||
it must "run migrations for oracle db" in {
|
||||
val oracleAppConfig =
|
||||
DLCOracleAppConfig(BitcoinSTestAppConfig.tmpDir(),
|
||||
dbConfig(ProjectType.Oracle))
|
||||
val result = oracleAppConfig.migrate()
|
||||
oracleAppConfig.driver match {
|
||||
case SQLite =>
|
||||
val expected = 1
|
||||
assert(result == expected)
|
||||
val flywayInfo = oracleAppConfig.info()
|
||||
|
||||
assert(flywayInfo.applied().length == expected)
|
||||
assert(flywayInfo.pending().length == 0)
|
||||
case PostgreSQL =>
|
||||
val expected = 1
|
||||
assert(result == expected)
|
||||
val flywayInfo = oracleAppConfig.info()
|
||||
|
||||
//+1 for << Flyway Schema Creation >>
|
||||
assert(flywayInfo.applied().length == expected + 1)
|
||||
assert(flywayInfo.pending().length == 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,9 +99,10 @@ object BitcoinSTestAppConfig {
|
||||
case object Wallet extends ProjectType
|
||||
case object Node extends ProjectType
|
||||
case object Chain extends ProjectType
|
||||
case object Oracle extends ProjectType
|
||||
case object Test extends ProjectType
|
||||
|
||||
val all = List(Wallet, Node, Chain, Test)
|
||||
val all = List(Wallet, Node, Chain, Oracle, Test)
|
||||
}
|
||||
|
||||
/** Generates a Typesafe config with DBs set to memory
|
||||
|
Loading…
Reference in New Issue
Block a user