-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initializing app in development mode by using ServiceConnection…
… - PostgresInitializer.kt has been removed
- Loading branch information
kamil.jedrzejuk
committed
Oct 8, 2024
1 parent
2ee37f5
commit 3b7448a
Showing
10 changed files
with
88 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...nTest/kotlin/camilyed/github/io/currencyexchangeapi/TestCurrencyExchangeApiApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package camilyed.github.io.currencyexchangeapi | ||
|
||
import camilyed.github.io.CurrencyExchangeApiApplication | ||
import camilyed.github.io.currencyexchangeapi.testing.config.DevelopmentTimeConfig | ||
import org.springframework.boot.builder.SpringApplicationBuilder | ||
|
||
fun main(args: Array<String>) { | ||
SpringApplicationBuilder() | ||
.sources(CurrencyExchangeApiApplication::class.java, DevelopmentTimeConfig::class.java) | ||
.profiles("test") | ||
.run(*args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...est/kotlin/camilyed/github/io/currencyexchangeapi/testing/config/DevelopmentTimeConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package camilyed.github.io.currencyexchangeapi.testing.config | ||
|
||
import org.springframework.boot.test.context.TestConfiguration | ||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection | ||
import org.springframework.context.annotation.Bean | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
class DevelopmentTimeConfig { | ||
|
||
@Bean | ||
@ServiceConnection | ||
fun postgresSQLContainer() = POSTGRES_SQL_CONTAINER | ||
} |
11 changes: 11 additions & 0 deletions
11
...Test/kotlin/camilyed/github/io/currencyexchangeapi/testing/config/PostgresSqlContainer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package camilyed.github.io.currencyexchangeapi.testing.config | ||
|
||
import org.testcontainers.containers.PostgreSQLContainer | ||
|
||
val POSTGRES_SQL_CONTAINER = PostgreSQLContainer("postgres:13.4-alpine") | ||
.apply { | ||
withDatabaseName("test_db") | ||
withUsername("test_user") | ||
withPassword("test_password") | ||
withInitScript("init.sql") | ||
} |
39 changes: 0 additions & 39 deletions
39
...est/kotlin/camilyed/github/io/currencyexchangeapi/testing/postgres/PostgresInitializer.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +0,0 @@ | ||
|
||
spring: | ||
datasource: | ||
url: jdbc:postgresql://localhost:5432/currency_exchange_db | ||
username: myuser | ||
password: mypassword | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
src/main/kotlin/camilyed/github/io/currencyexchangeapi/config/DataSourceConfig.kt
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
src/main/kotlin/camilyed/github/io/currencyexchangeapi/infrastructure/PostgresInitializer.kt
This file was deleted.
Oops, something went wrong.