update postgres test container

- update README.md
- update PostgresContainer
  - add TestExecutionListeners
  - remove ExtendWith
- update PostgresInitializer
  - cleanup
  - use properties for script and container
  - add afterTestClass
  - add beforeTestClass
  - extend TestExecutionListener
- remove PostgresExtension
- add debug logging to PostgresExecutor
- add ContainerUtils
- add dependencies
- extract function from PostgresExtension to PostgresExecutor
This commit is contained in:
2025-03-10 17:41:18 +01:00
parent 902a2a2c0b
commit 6aad7e3d63
7 changed files with 146 additions and 98 deletions

View File

@@ -2,18 +2,22 @@
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.
Initialize Postgres test container using spring properties for R2DBC,
script located in `src/<test path>/resources/postgres` folder.
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`.
* `schema.sql` file containing all structure and functions when star.
* `data.sql` file containing all data added before all test.
* `reset.sql` file containing all to reset database after all test.
### Properties For Test Container
if file exist it will be loaded...
| 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 |
## Releasing library