Skip to content

Commit

Permalink
feat: testcontainers 추가 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laeng committed Jan 3, 2024
1 parent a0c7515 commit c622cb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ val jsoupVersion = "1.17.1"
val jjwtVersion = "0.12.3"
val mockkVersion = "1.13.4"
val springMockkVersion = "4.0.2"
val testcontainersVersion = "1.19.3"
val testcontainersMysqlVersion = "1.19.3"
val kotestVersion = "5.7.2"
val kotestExtensionTestcontainers = "2.0.2"
val kotestExtensionSpring = "1.1.3"

dependencies {
Expand Down Expand Up @@ -87,9 +90,14 @@ dependencies {
// Spring Mockk
testImplementation("com.ninja-squad:springmockk:$springMockkVersion")

// Testcontainers
testImplementation("org.testcontainers:testcontainers:$testcontainersVersion")
testImplementation("org.testcontainers:mysql:$testcontainersMysqlVersion")

// Kotest
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest.extensions:kotest-extensions-testcontainers:$kotestExtensionTestcontainers")
testImplementation("io.kotest.extensions:kotest-extensions-spring:$kotestExtensionSpring")

// Mock Web Server
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
spring:
datasource:
url: jdbc:h2:mem:test;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
url: jdbc:tc:mysql:8://test_db
jpa:
hibernate:
ddl-auto: create
Expand Down

0 comments on commit c622cb0

Please sign in to comment.