-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : use testcontainers in dev mode
- Loading branch information
1 parent
af70a80
commit f0ea3f7
Showing
4 changed files
with
27 additions
and
35 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
22 changes: 22 additions & 0 deletions
22
...titenancy/partition/src/test/java/com/example/multitenancy/partition/TestApplication.java
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,22 @@ | ||
package com.example.multitenancy.partition; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
import org.springframework.context.annotation.Bean; | ||
import org.testcontainers.containers.PostgreSQLContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
public class TestApplication { | ||
|
||
@Bean | ||
@ServiceConnection | ||
PostgreSQLContainer<?> postgreSQLContainer() { | ||
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine")); | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.from(Application::main).with(TestApplication.class).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
29 changes: 0 additions & 29 deletions
29
...ition/src/test/java/com/example/multitenancy/partition/common/DBContainerInitializer.java
This file was deleted.
Oops, something went wrong.