Skip to content

Commit

Permalink
Upgrade to LocalStack 3.2.0 (awspring#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejwalkowiak committed Mar 10, 2024
1 parent 165de38 commit 4ce53fa
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ParameterStoreConfigDataLoaderIntegrationTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

@BeforeAll
static void beforeAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SecretsManagerConfigDataLoaderIntegrationTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

@TempDir
static Path tokenTempDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CloudWatchExportAutoConfigurationIntegrationTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2"));
DockerImageName.parse("localstack/localstack:3.2.0"));

@DynamicPropertySource
static void registerProperties(DynamicPropertyRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SqsAutoConfigurationIntegrationTest {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2"));
DockerImageName.parse("localstack/localstack:3.2.0"));

@SuppressWarnings("unchecked")
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class DynamoDbTemplateIntegrationTest {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

@BeforeAll
public static void createTable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CrossRegionS3ClientIntegrationTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2"));
DockerImageName.parse("localstack/localstack:3.2.0"));

private static S3Client client;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class S3PathMatchingResourcePatternResolverTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

private static ResourcePatternResolver resourceLoader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class S3ResourceIntegrationTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

private static S3Client client;
private static S3AsyncClient asyncClient;
Expand Down Expand Up @@ -194,7 +194,8 @@ void objectMetadataCanBeSetOnWriting(S3OutputStreamProvider s3OutputStreamProvid

@TestAvailableOutputStreamProviders
void contentTypeCanBeResolvedForLargeFiles(S3OutputStreamProvider s3OutputStreamProvider) throws IOException {
S3Resource resource = s3Resource("s3:https://first-bucket/new-file.txt", s3OutputStreamProvider);
int i = new Random().nextInt();
S3Resource resource = s3Resource("s3:https://first-bucket/new-file" + i + ".txt", s3OutputStreamProvider);

// create file larger than single part size in multipart upload to make sure that file can be successfully
// uploaded in parts
Expand All @@ -207,7 +208,7 @@ void contentTypeCanBeResolvedForLargeFiles(S3OutputStreamProvider s3OutputStream
outputStream.write(Files.toByteArray(file));
}
GetObjectResponse result = client
.getObject(request -> request.bucket("first-bucket").key("new-file.txt").build()).response();
.getObject(request -> request.bucket("first-bucket").key("new-file" + i + ".txt").build()).response();
assertThat(result.contentType()).isEqualTo("text/plain");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class S3TemplateIntegrationTests {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

private static S3Client client;

Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-aws-samples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.8"
services:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
image: localstack/localstack:2.3.2
image: localstack/localstack:3.2.0
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static io.awspring.cloud.sns.core.SnsHeaders.MESSAGE_GROUP_ID_HEADER;
import static org.assertj.core.api.Assertions.*;
import static org.awaitility.Awaitility.await;
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.SNS;
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.SQS;

import io.awspring.cloud.sns.Person;
Expand Down Expand Up @@ -63,7 +64,7 @@ class SnsTemplateIntegrationTest {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withServices(SQS).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

@BeforeAll
public static void createSnsTemplate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SnsSmsTemplateIntegrationTest {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withEnv("DEBUG", "1");
DockerImageName.parse("localstack/localstack:3.2.0")).withEnv("DEBUG", "1");

@BeforeAll
public static void createSnsTemplate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract class BaseSqsIntegrationTest {

protected static boolean waitForPurge = true;

private static final String LOCAL_STACK_VERSION = "localstack/localstack:2.3.2";
private static final String LOCAL_STACK_VERSION = "localstack/localstack:3.2.0";

static LocalStackContainer localstack = new LocalStackContainer(DockerImageName.parse(LOCAL_STACK_VERSION));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class BaseSqsIntegrationTest {

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:2.3.2")).withReuse(true);
DockerImageName.parse("localstack/localstack:3.2.0")).withReuse(true);

@BeforeAll
static void beforeAll() throws IOException, InterruptedException {
Expand Down

0 comments on commit 4ce53fa

Please sign in to comment.