An open API service indexing awesome lists of open source software.

https://github.com/kh77/sb-testcontainer

Spring boot integration test with test container
https://github.com/kh77/sb-testcontainer

java mysql spring-boot3 testcontainers

Last synced: 3 months ago
JSON representation

Spring boot integration test with test container

Awesome Lists containing this project

README

        

# Controller Test using 3 approach

* Integration Test by h2
* WebLayer Test by h2
* Test Container Test by MySQL

# For Postgres Driver and Test container

PostgreSQL Driver:


org.postgresql
postgresql
runtime

Spring Boot Test Dependency:


org.springframework.boot
spring-boot-starter-test
test

Testcontainers for PostgreSQL:


org.springframework.boot
spring-boot-testcontainers
test


org.testcontainers
junit-jupiter
test


org.testcontainers
postgresql
test

Creating a Docker container with the latest version of PostgreSQL

@Container
@ServiceConnection
private static PostgreSQLContainer> postgreSQLContainer = new PostgreSQLContainer<>("postgres:latest");