Update the tests that integrated with the database.
This commit is contained in:
+7
-2
@@ -8,6 +8,8 @@ import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
|||||||
import space.kklochko.jdbc_hospital_example.db.repositories.DepartmentRepository
|
import space.kklochko.jdbc_hospital_example.db.repositories.DepartmentRepository
|
||||||
import space.kklochko.jdbc_hospital_example.db.repositories.IndicatorRepository
|
import space.kklochko.jdbc_hospital_example.db.repositories.IndicatorRepository
|
||||||
import space.kklochko.jdbc_hospital_example.db.repositories.PatientRepository
|
import space.kklochko.jdbc_hospital_example.db.repositories.PatientRepository
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.CreateTables
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.TurnOnUUIDPlugin
|
||||||
import space.kklochko.jdbc_hospital_example.models.Indicator
|
import space.kklochko.jdbc_hospital_example.models.Indicator
|
||||||
import spock.lang.Shared
|
import spock.lang.Shared
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
@@ -31,8 +33,11 @@ class CommandEntitySpec extends Specification {
|
|||||||
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
||||||
dbc = new DataBaseConnection(db)
|
dbc = new DataBaseConnection(db)
|
||||||
|
|
||||||
IndicatorRepository repo = new IndicatorRepository(dbc)
|
TurnOnUUIDPlugin turnOnUUIDPlugin = new TurnOnUUIDPlugin()
|
||||||
repo.createTable()
|
turnOnUUIDPlugin.create(dbc)
|
||||||
|
|
||||||
|
CreateTables createTables = new CreateTables()
|
||||||
|
createTables.create(dbc)
|
||||||
|
|
||||||
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -4,6 +4,8 @@ import groovy.sql.Sql
|
|||||||
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile
|
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile
|
||||||
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig
|
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig
|
||||||
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.CreateTables
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.TurnOnUUIDPlugin
|
||||||
import space.kklochko.jdbc_hospital_example.models.Department
|
import space.kklochko.jdbc_hospital_example.models.Department
|
||||||
import spock.lang.Shared
|
import spock.lang.Shared
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
@@ -25,8 +27,11 @@ class DepartmentRepositorySpec extends Specification {
|
|||||||
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
||||||
dbc = new DataBaseConnection(db)
|
dbc = new DataBaseConnection(db)
|
||||||
|
|
||||||
DepartmentRepository repo = new DepartmentRepository(dbc)
|
TurnOnUUIDPlugin turnOnUUIDPlugin = new TurnOnUUIDPlugin()
|
||||||
repo.createTable()
|
turnOnUUIDPlugin.create(dbc)
|
||||||
|
|
||||||
|
CreateTables createTables = new CreateTables()
|
||||||
|
createTables.create(dbc)
|
||||||
|
|
||||||
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -4,6 +4,8 @@ import groovy.sql.Sql
|
|||||||
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile
|
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile
|
||||||
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig
|
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig
|
||||||
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.CreateTables
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.TurnOnUUIDPlugin
|
||||||
import space.kklochko.jdbc_hospital_example.models.Indicator
|
import space.kklochko.jdbc_hospital_example.models.Indicator
|
||||||
import spock.lang.Shared
|
import spock.lang.Shared
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
@@ -28,8 +30,11 @@ class IndicatorRepositorySpec extends Specification {
|
|||||||
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
||||||
dbc = new DataBaseConnection(db)
|
dbc = new DataBaseConnection(db)
|
||||||
|
|
||||||
IndicatorRepository repo = new IndicatorRepository(dbc)
|
TurnOnUUIDPlugin turnOnUUIDPlugin = new TurnOnUUIDPlugin()
|
||||||
repo.createTable()
|
turnOnUUIDPlugin.create(dbc)
|
||||||
|
|
||||||
|
CreateTables createTables = new CreateTables()
|
||||||
|
createTables.create(dbc)
|
||||||
|
|
||||||
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -4,6 +4,8 @@ import groovy.sql.Sql
|
|||||||
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile
|
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile
|
||||||
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig
|
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig
|
||||||
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.CreateTables
|
||||||
|
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.TurnOnUUIDPlugin
|
||||||
import space.kklochko.jdbc_hospital_example.models.Patient
|
import space.kklochko.jdbc_hospital_example.models.Patient
|
||||||
import spock.lang.Shared
|
import spock.lang.Shared
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
@@ -25,8 +27,11 @@ class PatientRepositorySpec extends Specification {
|
|||||||
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
db = (new LoadDataBaseConfigFromEnvFile()).load("db.testing")
|
||||||
dbc = new DataBaseConnection(db)
|
dbc = new DataBaseConnection(db)
|
||||||
|
|
||||||
PatientRepository repo = new PatientRepository(dbc)
|
TurnOnUUIDPlugin turnOnUUIDPlugin = new TurnOnUUIDPlugin()
|
||||||
repo.createTable()
|
turnOnUUIDPlugin.create(dbc)
|
||||||
|
|
||||||
|
CreateTables createTables = new CreateTables()
|
||||||
|
createTables.create(dbc)
|
||||||
|
|
||||||
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
sql = Sql.newInstance(db.getUrl(), db.getProperties().get("user"), db.getProperties().get("password"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user