Add support for Postgres trust host auth method with Docker Compose

See gh-41511
This commit is contained in:
sid
2024-07-16 00:25:09 -03:00
committed by Andy Wilkinson
parent d2cd5c9b98
commit af89924582
2 changed files with 15 additions and 0 deletions

View File

@@ -78,6 +78,12 @@ class PostgresEnvironmentTests {
assertThat(environment.getPassword()).isEqualTo("secret");
}
@Test
void getPasswordWhenHasTrustHostAuthMethod() {
PostgresEnvironment environment = new PostgresEnvironment(Map.of("POSTGRES_HOST_AUTH_METHOD", "trust"));
assertThat(environment.getPassword()).isNull();
}
@Test
void getDatabaseWhenNoPostgresDbOrPostgresUser() {
PostgresEnvironment environment = new PostgresEnvironment(Map.of("POSTGRES_PASSWORD", "secret"));