diff --git a/aws-cloudwatch-project/src/test/java/com/example/awsspring/TestApplication.java b/aws-cloudwatch-project/src/test/java/com/example/awsspring/TestApplication.java index bad59275..9851e70e 100644 --- a/aws-cloudwatch-project/src/test/java/com/example/awsspring/TestApplication.java +++ b/aws-cloudwatch-project/src/test/java/com/example/awsspring/TestApplication.java @@ -15,7 +15,7 @@ public class TestApplication { @ServiceConnection LocalStackContainer localstackContainer() { return new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.5.0")); + DockerImageName.parse("localstack/localstack").withTag("3.7.1")); } @Bean diff --git a/aws-dynamodb-project/src/test/java/com/learning/awsspring/TestApplication.java b/aws-dynamodb-project/src/test/java/com/learning/awsspring/TestApplication.java index 4fe4a4e0..4c198faa 100644 --- a/aws-dynamodb-project/src/test/java/com/learning/awsspring/TestApplication.java +++ b/aws-dynamodb-project/src/test/java/com/learning/awsspring/TestApplication.java @@ -20,7 +20,7 @@ public class TestApplication { LocalStackContainer localstackContainer() { LocalStackContainer localstackContainer = new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.6.0")) + DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withCopyFileToContainer( MountableFile.forHostPath(".localstack/"), "/etc/localstack/init/ready.d/") diff --git a/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/TestKinesisConsumerApplication.java b/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/TestKinesisConsumerApplication.java index 3a2ca008..daa37db3 100644 --- a/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/TestKinesisConsumerApplication.java +++ b/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/TestKinesisConsumerApplication.java @@ -7,6 +7,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.testcontainers.containers.PostgreSQLContainer; +import org.testcontainers.utility.DockerImageName; @TestConfiguration(proxyBeanMethods = false) @Import(LocalStackConfig.class) @@ -15,7 +16,7 @@ public class TestKinesisConsumerApplication { @Bean @ServiceConnection PostgreSQLContainer postgreSQLContainer() { - return new PostgreSQLContainer<>("postgres:16.4-alpine"); + return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine")); } public static void main(String[] args) { diff --git a/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/common/LocalStackConfig.java b/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/common/LocalStackConfig.java index 4efbe5e8..f87f4388 100644 --- a/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/common/LocalStackConfig.java +++ b/aws-kinesis-project/consumer/src/test/java/com/learning/aws/spring/common/LocalStackConfig.java @@ -20,7 +20,7 @@ public class LocalStackConfig { static LocalStackContainer localStackContainer = new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.5.0")); + DockerImageName.parse("localstack/localstack").withTag("3.7.1")); static { localStackContainer.start(); diff --git a/aws-kinesis-project/producer/src/test/java/com/learning/aws/spring/TestKinesisProducerApplication.java b/aws-kinesis-project/producer/src/test/java/com/learning/aws/spring/TestKinesisProducerApplication.java index c8d4ef85..d316b34d 100644 --- a/aws-kinesis-project/producer/src/test/java/com/learning/aws/spring/TestKinesisProducerApplication.java +++ b/aws-kinesis-project/producer/src/test/java/com/learning/aws/spring/TestKinesisProducerApplication.java @@ -20,7 +20,7 @@ public class TestKinesisProducerApplication { LocalStackContainer localStackContainer(DynamicPropertyRegistry dynamicPropertyRegistry) { LocalStackContainer localStackContainer = new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.6.0")); + DockerImageName.parse("localstack/localstack").withTag("3.7.1")); dynamicPropertyRegistry.add("spring.cloud.aws.endpoint", localStackContainer::getEndpoint); dynamicPropertyRegistry.add( "spring.cloud.aws.region.static", localStackContainer::getRegion); diff --git a/aws-lambda-project/src/test/java/com/learning/awslambda/ApplicationIntegrationTest.java b/aws-lambda-project/src/test/java/com/learning/awslambda/ApplicationIntegrationTest.java index 65ab2b3d..bcfd6d03 100644 --- a/aws-lambda-project/src/test/java/com/learning/awslambda/ApplicationIntegrationTest.java +++ b/aws-lambda-project/src/test/java/com/learning/awslambda/ApplicationIntegrationTest.java @@ -57,14 +57,14 @@ class ApplicationIntegrationTest { static Network network = Network.newNetwork(); @Container - static PostgreSQLContainer postgres = new PostgreSQLContainer<>("postgres:16.2-alpine") + static PostgreSQLContainer postgres = new PostgreSQLContainer<>("postgres:16.4-alpine") .withNetwork(network) .withNetworkAliases("postgres") .withReuse(true); @Container static LocalStackContainer localstack = new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.3.0")) + DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withNetwork(network) .withEnv("LOCALSTACK_HOST", "localhost.localstack.cloud") .withEnv("LAMBDA_DOCKER_NETWORK", ((Network.NetworkImpl) network).getName()) diff --git a/aws-lambda-project/src/test/java/com/learning/awslambda/common/ContainersConfig.java b/aws-lambda-project/src/test/java/com/learning/awslambda/common/ContainersConfig.java index caf4cd48..c9118256 100644 --- a/aws-lambda-project/src/test/java/com/learning/awslambda/common/ContainersConfig.java +++ b/aws-lambda-project/src/test/java/com/learning/awslambda/common/ContainersConfig.java @@ -12,6 +12,6 @@ public class ContainersConfig { @Bean @ServiceConnection PostgreSQLContainer postgreSQLContainer() { - return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine")); + return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine")); } } diff --git a/aws-parameterstore-project/src/test/java/com/example/awsspring/TestApplication.java b/aws-parameterstore-project/src/test/java/com/example/awsspring/TestApplication.java index 0842fee8..4c4e7a85 100644 --- a/aws-parameterstore-project/src/test/java/com/example/awsspring/TestApplication.java +++ b/aws-parameterstore-project/src/test/java/com/example/awsspring/TestApplication.java @@ -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 TestApplication { @@ -12,7 +13,7 @@ public class TestApplication { @Bean @ServiceConnection PostgreSQLContainer sqlContainer() { - return new PostgreSQLContainer<>("postgres:16.3-alpine"); + return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine")); } public static void main(String[] args) { diff --git a/aws-parameterstore-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java b/aws-parameterstore-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java index 075995e4..56d1f8ea 100644 --- a/aws-parameterstore-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java +++ b/aws-parameterstore-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java @@ -14,7 +14,7 @@ public class LocalStackContainerConfig { @Container private static final LocalStackContainer localStackContainer = - new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.6.0")) + new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withCopyFileToContainer( MountableFile.forHostPath("localstack/"), "/etc/localstack/init/ready.d/") diff --git a/aws-s3-project/src/test/java/com/learning/awspring/TestS3Application.java b/aws-s3-project/src/test/java/com/learning/awspring/TestS3Application.java index 0a5abe55..19baa556 100644 --- a/aws-s3-project/src/test/java/com/learning/awspring/TestS3Application.java +++ b/aws-s3-project/src/test/java/com/learning/awspring/TestS3Application.java @@ -19,7 +19,7 @@ public class TestS3Application { @ServiceConnection @RestartScope PostgreSQLContainer postgresContainer() { - return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine")) + return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine")) .withReuse(true); } @@ -27,7 +27,7 @@ PostgreSQLContainer postgresContainer() { LocalStackContainer localstackContainer(DynamicPropertyRegistry registry) { LocalStackContainer localStackContainer = new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.6.0")) + DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withCopyFileToContainer( MountableFile.forHostPath(".localstack/"), "/etc/localstack/init/ready.d/") diff --git a/aws-secretmanager-project/src/test/java/com/example/awsspring/TestApplication.java b/aws-secretmanager-project/src/test/java/com/example/awsspring/TestApplication.java index 4f54c02e..f56f38b1 100644 --- a/aws-secretmanager-project/src/test/java/com/example/awsspring/TestApplication.java +++ b/aws-secretmanager-project/src/test/java/com/example/awsspring/TestApplication.java @@ -19,7 +19,7 @@ public class TestApplication { @ServiceConnection LocalStackContainer localStackContainer() { return new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.6.0")) + DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withCopyFileToContainer( MountableFile.forHostPath("localstack/"), "/etc/localstack/init/ready.d/") .waitingFor(Wait.forLogMessage(".*LocalStack initialized successfully\n", 1)); diff --git a/aws-secretmanager-project/src/test/java/com/example/awsspring/common/DBTestContainer.java b/aws-secretmanager-project/src/test/java/com/example/awsspring/common/DBTestContainer.java index 1af281d9..75062b70 100644 --- a/aws-secretmanager-project/src/test/java/com/example/awsspring/common/DBTestContainer.java +++ b/aws-secretmanager-project/src/test/java/com/example/awsspring/common/DBTestContainer.java @@ -3,9 +3,11 @@ import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.testcontainers.containers.PostgreSQLContainer; import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.utility.DockerImageName; public interface DBTestContainer { @Container @ServiceConnection - PostgreSQLContainer sqlContainer = new PostgreSQLContainer<>("postgres:16.2-alpine"); + PostgreSQLContainer sqlContainer = + new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.4-alpine")); } diff --git a/aws-secretmanager-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java b/aws-secretmanager-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java index f4da8470..d34701d5 100644 --- a/aws-secretmanager-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java +++ b/aws-secretmanager-project/src/test/java/com/example/awsspring/common/LocalStackContainerConfig.java @@ -14,7 +14,7 @@ public class LocalStackContainerConfig { @Container private static final LocalStackContainer localStackContainer = - new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.3.0")) + new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withCopyFileToContainer( MountableFile.forHostPath("localstack/"), "/etc/localstack/init/ready.d/") diff --git a/aws-ses-project/src/test/java/com/example/awsspring/TestSESApplication.java b/aws-ses-project/src/test/java/com/example/awsspring/TestSESApplication.java index c300d249..702b4d85 100644 --- a/aws-ses-project/src/test/java/com/example/awsspring/TestSESApplication.java +++ b/aws-ses-project/src/test/java/com/example/awsspring/TestSESApplication.java @@ -1,31 +1,11 @@ package com.example.awsspring; -import lombok.extern.slf4j.Slf4j; +import com.example.awsspring.common.LocalStackTestContainer; import org.springframework.boot.SpringApplication; -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.localstack.LocalStackContainer; -import org.testcontainers.containers.output.Slf4jLogConsumer; -import org.testcontainers.utility.DockerImageName; -@Slf4j -@TestConfiguration(proxyBeanMethods = false) public class TestSESApplication { - @Bean - @ServiceConnection - LocalStackContainer localStackContainer() { - LocalStackContainer localStackContainer = - new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.6.0")); - localStackContainer.start(); - Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log); - localStackContainer.followOutput(logConsumer); - return localStackContainer; - } - public static void main(String[] args) { - SpringApplication.from(SESApplication::main).with(TestSESApplication.class).run(args); + SpringApplication.from(SESApplication::main).with(LocalStackTestContainer.class).run(args); } } diff --git a/aws-ses-project/src/test/java/com/example/awsspring/common/AbstractIntegrationTest.java b/aws-ses-project/src/test/java/com/example/awsspring/common/AbstractIntegrationTest.java index 3c23e08b..54e7355e 100644 --- a/aws-ses-project/src/test/java/com/example/awsspring/common/AbstractIntegrationTest.java +++ b/aws-ses-project/src/test/java/com/example/awsspring/common/AbstractIntegrationTest.java @@ -3,7 +3,6 @@ import static com.example.awsspring.utils.AppConstants.PROFILE_TEST; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -import com.example.awsspring.TestSESApplication; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -12,7 +11,7 @@ import org.springframework.test.web.servlet.MockMvc; @ActiveProfiles({PROFILE_TEST}) -@SpringBootTest(webEnvironment = RANDOM_PORT, classes = TestSESApplication.class) +@SpringBootTest(webEnvironment = RANDOM_PORT, classes = LocalStackTestContainer.class) @AutoConfigureMockMvc public abstract class AbstractIntegrationTest { diff --git a/aws-ses-project/src/test/java/com/example/awsspring/common/LocalStackTestContainer.java b/aws-ses-project/src/test/java/com/example/awsspring/common/LocalStackTestContainer.java new file mode 100644 index 00000000..604b1b77 --- /dev/null +++ b/aws-ses-project/src/test/java/com/example/awsspring/common/LocalStackTestContainer.java @@ -0,0 +1,26 @@ +package com.example.awsspring.common; + +import lombok.extern.slf4j.Slf4j; +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.localstack.LocalStackContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.utility.DockerImageName; + +@Slf4j +@TestConfiguration(proxyBeanMethods = false) +public class LocalStackTestContainer { + + @Bean + @ServiceConnection + LocalStackContainer localStackContainer() { + LocalStackContainer localStackContainer = + new LocalStackContainer( + DockerImageName.parse("localstack/localstack").withTag("3.7.1")); + localStackContainer.start(); + Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log); + localStackContainer.followOutput(logConsumer); + return localStackContainer; + } +} diff --git a/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java b/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java index 5715dc6d..c979b0ac 100644 --- a/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java +++ b/aws-sns-project/src/test/java/com/learning/awssns/common/ContainersConfig.java @@ -13,6 +13,6 @@ public class ContainersConfig { @ServiceConnection LocalStackContainer localstackContainer() { return new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.7.0")); + DockerImageName.parse("localstack/localstack").withTag("3.7.1")); } } diff --git a/aws-sqs-project/src/test/java/com/learning/awspring/config/LocalStackTestContainers.java b/aws-sqs-project/src/test/java/com/learning/awspring/config/LocalStackTestContainers.java index a23ae099..7f5d4753 100644 --- a/aws-sqs-project/src/test/java/com/learning/awspring/config/LocalStackTestContainers.java +++ b/aws-sqs-project/src/test/java/com/learning/awspring/config/LocalStackTestContainers.java @@ -13,7 +13,7 @@ public class LocalStackTestContainers { @ServiceConnection LocalStackContainer localstackContainer() { return new LocalStackContainer( - DockerImageName.parse("localstack/localstack").withTag("3.7.0")) + DockerImageName.parse("localstack/localstack").withTag("3.7.1")) .withReuse(true); } }