From cdfdaa878b981dc8a94cc7e38c1f8ba6d800f5bd Mon Sep 17 00:00:00 2001 From: Maciej Walkowiak Date: Wed, 18 Sep 2024 07:12:52 +0200 Subject: [PATCH] Upgrade AWS SDK to 2.28.2 (#1216) --- .../cloud/autoconfigure/ConfiguredAwsPresigner.java | 4 ++-- spring-cloud-aws-dependencies/pom.xml | 2 +- .../test/java/io/awspring/cloud/s3/ObjectMetadataTests.java | 6 +++--- .../awspring/cloud/sqs/integration/SqsIntegrationTests.java | 6 +++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/ConfiguredAwsPresigner.java b/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/ConfiguredAwsPresigner.java index 2e933c832..694fd868a 100644 --- a/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/ConfiguredAwsPresigner.java +++ b/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/ConfiguredAwsPresigner.java @@ -38,11 +38,11 @@ public ConfiguredAwsPresigner(SdkPresigner presigner) { } public URI getEndpoint() { - return attributes.get(SdkClientOption.ENDPOINT); + return attributes.get(SdkClientOption.CLIENT_ENDPOINT_PROVIDER).clientEndpoint(); } public boolean isEndpointOverridden() { - return attributes.get(SdkClientOption.ENDPOINT_OVERRIDDEN); + return attributes.get(SdkClientOption.CLIENT_ENDPOINT_PROVIDER).isEndpointOverridden(); } public Boolean getFipsEnabled() { diff --git a/spring-cloud-aws-dependencies/pom.xml b/spring-cloud-aws-dependencies/pom.xml index e0a4dc7bd..e7d025376 100644 --- a/spring-cloud-aws-dependencies/pom.xml +++ b/spring-cloud-aws-dependencies/pom.xml @@ -24,7 +24,7 @@ 2.31.0 - 2.25.70 + 2.28.2 2.0.4 1.6 4.1.4 diff --git a/spring-cloud-aws-s3/src/test/java/io/awspring/cloud/s3/ObjectMetadataTests.java b/spring-cloud-aws-s3/src/test/java/io/awspring/cloud/s3/ObjectMetadataTests.java index d8ed4ea80..351fb9a4f 100644 --- a/spring-cloud-aws-s3/src/test/java/io/awspring/cloud/s3/ObjectMetadataTests.java +++ b/spring-cloud-aws-s3/src/test/java/io/awspring/cloud/s3/ObjectMetadataTests.java @@ -53,9 +53,9 @@ void canBeAppliedToPutObjectRequest() { PutObjectRequest.Builder builder = PutObjectRequest.builder(); objectMetadata.apply(builder); - assertThat(builder) - .usingRecursiveComparison().ignoringFields("awsRequestOverrideConfig", "checksumCRC32C", "checksumSHA1", - "checksumSHA256", "key", "contentMD5", "bucket", "checksumCRC32", "contentLength") + assertThat(builder).usingRecursiveComparison() + .ignoringFields("awsRequestOverrideConfig", "checksumCRC32C", "checksumSHA1", "checksumSHA256", "key", + "contentMD5", "bucket", "checksumCRC32", "contentLength", "ifNoneMatch") .isEqualTo(objectMetadata); } diff --git a/spring-cloud-aws-sqs/src/test/java/io/awspring/cloud/sqs/integration/SqsIntegrationTests.java b/spring-cloud-aws-sqs/src/test/java/io/awspring/cloud/sqs/integration/SqsIntegrationTests.java index 5e8aa2d78..50bded839 100644 --- a/spring-cloud-aws-sqs/src/test/java/io/awspring/cloud/sqs/integration/SqsIntegrationTests.java +++ b/spring-cloud-aws-sqs/src/test/java/io/awspring/cloud/sqs/integration/SqsIntegrationTests.java @@ -17,6 +17,7 @@ import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import com.fasterxml.jackson.databind.ObjectMapper; @@ -188,7 +189,10 @@ void receivesMessageBatch() throws Exception { List> messages = create10Messages("receivesMessageBatch"); sqsTemplate.sendMany(RECEIVES_MESSAGE_BATCH_QUEUE_NAME, messages); logger.debug("Sent 10 messages to queue {}", RECEIVES_MESSAGE_BATCH_QUEUE_NAME); - assertThat(latchContainer.receivesMessageBatchLatch.await(10, TimeUnit.SECONDS)).isTrue(); + await().untilAsserted(() -> { + // ensure that first batch was processed more than once + assertThat(latchContainer.receivesMessageBatchLatch.getCount()).isLessThan(10); + }); assertThat(latchContainer.acknowledgementCallbackBatchLatch.await(10, TimeUnit.SECONDS)).isTrue(); }