Open ShubhamShekhar1996 opened 1 year ago
You can do it like this to change default values for database name, username and password:
private static final PostgreSQLContainer<?> postgresContainer = new PostgreSQLContainer<>(DockerImageName.parse(
"postgres:16-alpine"
))
.withDatabaseName("")
.withUsername("")
.withPassword("");
Ports on host are generated randomly by design. You can get more information in the official documentation: Exposing container ports to the host
How do we change the default Database name or username and container port for Container in junit test in Junit5? By default it takes everything as test. Junit5, Spring boot- 3.1.3