Rewrite postgres test container

This commit is contained in:
2025-08-12 13:01:15 +02:00
committed by swordsteel
parent 4bc14b5340
commit 2328e7ebe2
10 changed files with 147 additions and 170 deletions

View File

@@ -2,22 +2,19 @@
In the forge of software development, where annotations ignite, A crucible of testing, common classes to excite. Each annotation examined, with attention to detail and might, Their effects on code behavior, tested through day and night. From mockk objects to test doubles, a toolkit to refine, Developers and testers, their skills to redefine. The Annotation Validator, a sentinel of code integrity true, A library of verification, where testing wisdom shines anew.
## Postgres Test Container
`@PostgresContainer` Annotation for integration tests.
`@PostgresTestContainer` Annotation for integration tests.
Initialize Postgres test container using spring properties for R2DBC,
script located in `src/<test path>/resources` folder. And specify properties in `src/<test path>/resources/application.properties`.
Initialize Postgres test container using test container default properties, script located in `src/<test path>/resources/postgres/` folder.
### Properties For Test Container
| name | required | example | info |
|----------------------------|:--------:|-------------|----------------------------------------------------------------|
| container.postgres.version | | postgres:17 | postgres container default postgres:latest |
| container.postgres.init | &check; | schema.sql | Postgres init script containing all structure and functions |
| container.postgres.before | | data.sql | Postgres data script containing all data to populate database |
| container.postgres.after | | reset.sql | Postgres reset script containing all command to reset database |
| file | required | info |
|---------------------|:--------:|----------------------------------------------------------------|
| postgres/schema.sql | &check; | Postgres init script containing all structure and functions |
| postgres/data.sql | | Postgres data script containing all data to populate database |
| postgres/reset.sql | | Postgres reset script containing all command to reset database |
## Releasing library