Reverse Lookup for activities
This commit is contained in:
parent
612d67ccda
commit
debc55d484
22 changed files with 347 additions and 94 deletions
|
|
@ -3,7 +3,11 @@ package net.javahippie.fitpub.config;
|
|||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.testcontainers.containers.BindMode;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
import org.testcontainers.containers.startupcheck.IsRunningStartupCheckStrategy;
|
||||
import org.testcontainers.containers.startupcheck.StartupCheckStrategy;
|
||||
import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
/**
|
||||
|
|
@ -16,17 +20,21 @@ public class TestcontainersConfiguration {
|
|||
/**
|
||||
* PostgreSQL container with PostGIS extension for tests.
|
||||
* PostGIS image is treated as a standard PostgreSQL container.
|
||||
*
|
||||
* @ServiceConnection automatically configures the datasource from this container.
|
||||
*/
|
||||
@Bean
|
||||
@ServiceConnection
|
||||
public PostgreSQLContainer<?> postgresContainer() {
|
||||
return new PostgreSQLContainer<>(
|
||||
DockerImageName.parse("postgis/postgis:16-3.4")
|
||||
.asCompatibleSubstituteFor("postgres")
|
||||
DockerImageName.parse("postgis/postgis:16-3.4")
|
||||
.asCompatibleSubstituteFor("postgres")
|
||||
)
|
||||
.withDatabaseName("testdb")
|
||||
.withUsername("test")
|
||||
.withPassword("test");
|
||||
.withDatabaseName("testdb")
|
||||
.withUsername("test")
|
||||
.withPassword("test")
|
||||
.waitingFor(new HostPortWaitStrategy())
|
||||
.withReuse(true)
|
||||
.withFileSystemBind(".postgresdata", "/var/lib/postgresql/data", BindMode.READ_WRITE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue