fix: use asCompatibleSubstituteFor for TimescaleDB Testcontainer image
This commit is contained in:
@@ -8,14 +8,19 @@ import org.springframework.test.context.DynamicPropertySource;
|
|||||||
import org.testcontainers.containers.PostgreSQLContainer;
|
import org.testcontainers.containers.PostgreSQLContainer;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||||
|
import org.testcontainers.utility.DockerImageName;
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||||
@Testcontainers
|
@Testcontainers
|
||||||
public abstract class AbstractPostgresIT {
|
public abstract class AbstractPostgresIT {
|
||||||
|
|
||||||
|
private static final DockerImageName TIMESCALEDB_IMAGE =
|
||||||
|
DockerImageName.parse("timescale/timescaledb:latest-pg16")
|
||||||
|
.asCompatibleSubstituteFor("postgres");
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final PostgreSQLContainer<?> postgres =
|
static final PostgreSQLContainer<?> postgres =
|
||||||
new PostgreSQLContainer<>("timescale/timescaledb:latest-pg16")
|
new PostgreSQLContainer<>(TIMESCALEDB_IMAGE)
|
||||||
.withDatabaseName("cameleer3")
|
.withDatabaseName("cameleer3")
|
||||||
.withUsername("cameleer")
|
.withUsername("cameleer")
|
||||||
.withPassword("test");
|
.withPassword("test");
|
||||||
|
|||||||
Reference in New Issue
Block a user