GH-48: Upgrade to spring-integration-aws:3.0.6

Fixes: #48

* Adjust `AmazonS3UploadFileTests` to new reality in the `S3MessageHandler` for `File` uploads.
Related to: f2aded0686
This commit is contained in:
Artem Bilan
2024-03-28 12:27:22 -04:00
parent a6bce0d961
commit fd33ff9edc
2 changed files with 5 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.test.context.TestPropertySource;
import org.springframework.util.FileCopyUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.atLeastOnce;
@@ -46,7 +47,7 @@ public class AmazonS3UploadFileTests extends AbstractAwsS3ConsumerMockTests {
S3AsyncClient.class);
File file = new File(temporaryRemoteFolder.toFile(), "foo.mp3");
file.createNewFile();
FileCopyUtils.copy(new byte[] { 1 }, file);
Message<?> message = MessageBuilder.withPayload(file).build();
this.s3Consumer.accept(message);
@@ -60,13 +61,13 @@ public class AmazonS3UploadFileTests extends AbstractAwsS3ConsumerMockTests {
assertThat(putObjectRequest.bucket()).isEqualTo(S3_BUCKET);
assertThat(putObjectRequest.key()).isEqualTo("foo.mp3");
assertThat(putObjectRequest.contentMD5()).isEqualTo(Md5Utils.md5AsBase64(file));
assertThat(putObjectRequest.contentLength()).isEqualTo(0L);
assertThat(putObjectRequest.contentLength()).isEqualTo(1L);
assertThat(putObjectRequest.contentType()).isEqualTo("audio/mpeg");
assertThat(putObjectRequest.acl()).isEqualTo(ObjectCannedACL.PUBLIC_READ_WRITE);
AsyncRequestBody asyncRequestBody = asyncRequestBodyArgumentCaptor.getValue();
StepVerifier.create(asyncRequestBody)
.assertNext((buffer) -> assertThat(TestUtils.getPropertyValue(buffer, "hb", byte[].class)).isEmpty())
.assertNext((buffer) -> assertThat(buffer.limit()).isEqualTo(1))
.expectComplete()
.verify();

View File

@@ -7,7 +7,7 @@ ext {
djlVersion = '0.26.0'
djlSpringVersion = '0.26'
springIntegrationAws = 'org.springframework.integration:spring-integration-aws:3.0.5'
springIntegrationAws = 'org.springframework.integration:spring-integration-aws:3.0.6'
ftpserverCore = 'org.apache.ftpserver:ftpserver-core:1.2.0'
mockserverNetty = 'org.mock-server:mockserver-netty:5.15.0'
twitter4jStream = 'org.twitter4j:twitter4j-stream:4.0.7'