diff --git a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt index 7ebf3c37..72cf7e47 100644 --- a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt +++ b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt @@ -66,17 +66,17 @@ open class SimpleEndpoint( dataSource!! } else { val dataSourceNew = DataSource() - if (properties().containsKey("jdbc.url")) { - dataSourceNew.url = properties()["jdbc.url"].toString() + if (properties().containsKey("jdbc_url")) { + dataSourceNew.url = properties()["jdbc_url"].toString() } else { - val jdbcProtocol = properties()["jdbc.protocol"] - val dbName = properties()["db.name"] - val dbPort = properties()["db.port"] + val jdbcProtocol = properties()["jdbc_protocol"] + val dbName = properties()["db_name"] + val dbPort = properties()["db_port"] dataSourceNew.url = "$jdbcProtocol://$host:$dbPort/$dbName" } - dataSourceNew.driverClassName = properties()["jdbc.driver.class.name"].toString() - dataSourceNew.username = properties()["db.user"].toString() - dataSourceNew.password = properties()["db.password"].toString() + dataSourceNew.driverClassName = properties()["jdbc_driver_class_name"].toString() + dataSourceNew.username = properties()["db_user"].toString() + dataSourceNew.password = properties()["db_password"].toString() dataSourceNew.minIdle = 1 dataSourceNew.maxActive = 3 dataSourceNew.maxIdle = 3 diff --git a/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceType.kt b/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceType.kt index e63bfcfe..9bafcd46 100644 --- a/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceType.kt +++ b/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceType.kt @@ -78,7 +78,7 @@ class FsResourceType( fun resourceTypes() = resourceTypes private val resourceTypes: List = - walk(FileSystemResource(endpoints.first().properties()["fs.base.folder"].toString()).file.path) + walk(FileSystemResource(endpoints.first().properties()["fs_base_folder"].toString()).file.path) private fun walk(path: String) = File(path) diff --git a/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceType.kt b/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceType.kt index 551e6525..f9b8d0cd 100644 --- a/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceType.kt +++ b/src/main/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceType.kt @@ -83,7 +83,7 @@ class SqlResourceType( endpoints .map { connection -> return@map createQuery(uri, connection, specificDialect - ?: connection.properties()["sql.dialect"].toString()).execute(hashMapOf("uri" to uri)) + ?: connection.properties()["sql_dialect"].toString()).execute(hashMapOf("uri" to uri)) .map?> { val toMutableMap = it.toMutableMap() toMutableMap["endpoint"] = connection.name() diff --git a/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceTypeTest.kt b/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceTypeTest.kt index 48f0e377..33eeb02b 100644 --- a/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceTypeTest.kt +++ b/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/FsResourceTypeTest.kt @@ -63,10 +63,10 @@ class FsResourceTypeTest { dbMd.host = "127.0.0.1" dbMd.properties = """ { - "fs.base.folder": "conf/h2/md/database", - "sql.dialect": "h2", - "jdbc.url": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';", - "jdbc.driver.class.name": "org.h2.Driver" + "fs_base_folder": "conf/h2/md/database", + "sql_dialect": "h2", + "jdbc_url": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';", + "jdbc_driver_class_name": "org.h2.Driver" } """.trimIndent() } diff --git a/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceTypeTest.kt b/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceTypeTest.kt index b3adadb5..4e3e7621 100644 --- a/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceTypeTest.kt +++ b/src/test/kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl/SqlResourceTypeTest.kt @@ -61,9 +61,9 @@ class SqlResourceTypeTest { db.host = "127.0.0.1" db.properties = """ { - "sql.dialect": "h2", - "jdbc.url": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';", - "jdbc.driver.class.name": "org.h2.Driver" + "sql_dialect": "h2", + "jdbc_url": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';", + "jdbc_driver_class_name": "org.h2.Driver" } """.trimIndent() } diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 4142dc97..1899a9ea 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -10,10 +10,10 @@ conf: host: 127.0.0.1 properties: > { - "sql.dialect": "h2", - "fs.base.folder": "conf/h2/md/database", - "jdbc.url": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';", - "jdbc.driver.class.name": "org.h2.Driver", + "sql_dialect": "h2", + "fs_base_folder": "conf/h2/md/database", + "jdbc_url": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';", + "jdbc_driver_class_name": "org.h2.Driver", "jdbc.user": "", "jdbc.password": "", "os.query.rest.port": "8082",