Class PostgresTestConfiguration

java.lang.Object
com.irurueta.authserver.testsupport.PostgresTestConfiguration

@TestConfiguration(proxyBeanMethods=false) public class PostgresTestConfiguration extends Object
Exposes a PostgreSQL Testcontainers container as a Spring Boot service connection, so the DataSource (and Flyway) of a test context is wired to it automatically.
  • Field Details

    • POSTGRES_IMAGE

      public static final String POSTGRES_IMAGE
      Docker image used for the PostgreSQL container (same major version as compose.yaml).
      See Also:
  • Constructor Details

    • PostgresTestConfiguration

      public PostgresTestConfiguration()
  • Method Details

    • postgresContainer

      @Bean public org.testcontainers.postgresql.PostgreSQLContainer postgresContainer()
      Creates the PostgreSQL container.
      Returns:
      the container, started and stopped by the Spring context lifecycle.