Skip to content

Commit

Permalink
chore(deps) : upgrade to postgres 16.3-alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed May 10, 2024
1 parent 5f36cb3 commit af70a80
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
public interface TestContainersConfig {

@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.2-alpine");
PostgreSQLContainer<?> postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.3-alpine");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestApplication {
Expand All @@ -14,7 +15,7 @@ public class TestApplication {
@ServiceConnection
@RestartScope
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.2-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestApplication {

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.2-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine")).withReuse(true);
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine")).withReuse(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestApplication {

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.2-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

public interface TestContainersConfig {

@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.2-alpine");
PostgreSQLContainer<?> postgreSQLContainer =
new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
Expand All @@ -28,7 +29,7 @@ class ApplicationIntegrationTest {

@Container
private static final PostgreSQLContainer<?> POSTGRE_SQL_CONTAINER =
new PostgreSQLContainer<>("postgres:16.2-alpine");
new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));

@DynamicPropertySource
static void registerDynamicProperties(DynamicPropertyRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.2-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.3-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class DBContainerInitializer {

private static final PostgreSQLContainer<?> POSTGRE_SQL_CONTAINER =
new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.1-alpine"))
new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.3-alpine"))
.withReuse(true);

private static final OracleContainer ORACLE_CONTAINER =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import org.testcontainers.containers.MariaDBContainer;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.lifecycle.Startables;
import org.testcontainers.utility.DockerImageName;

public class DBContainerInitializer
implements ApplicationContextInitializer<ConfigurableApplicationContext> {

private static final PostgreSQLContainer<?> sqlContainer =
new PostgreSQLContainer<>("postgres:16.1-alpine");
new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));

private static final MariaDBContainer<?> mariaDBContainer = new MariaDBContainer<>("mariadb");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

public class DBContainerInitializer
implements ApplicationContextInitializer<ConfigurableApplicationContext> {

private static final PostgreSQLContainer<?> sqlContainer =
new PostgreSQLContainer<>("postgres:15-alpine")
new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"))
.withDatabaseName("integration-tests-db")
.withUsername("username")
.withPassword("password");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestContainersConfiguration {
Expand All @@ -13,6 +14,6 @@ public class TestContainersConfiguration {
@ServiceConnection
@RestartScope
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.1-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;

@TestConfiguration(proxyBeanMethods = false)
Expand All @@ -13,7 +14,7 @@ public class TestApplication {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.2-alpine")
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("init.sql"),
"/docker-entrypoint-initdb.d/init.sql");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestApplication {

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.2-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestApplication {

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.1-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
properties = {
"spring.jpa.hibernate.ddl-auto=validate",
"spring.test.database.replace=none",
"spring.datasource.url=jdbc:tc:postgresql:16.2-alpine:///db"
"spring.datasource.url=jdbc:tc:postgresql:16.3-alpine:///db"
})
class SchemaValidationTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
}
}

0 comments on commit af70a80

Please sign in to comment.