diff --git a/build.gradle b/build.gradle index 68a5f6a..18282cd 100644 --- a/build.gradle +++ b/build.gradle @@ -29,15 +29,15 @@ ext { assertjVersion = '3.19.0' awaitilityVersion = '4.0.3' dynamodbLockClientVersion = '1.1.0' - jacksonVersion = '2.12.2' - junitVersion = '5.7.0' + jacksonVersion = '2.12.3' + junitVersion = '5.7.2' servletApiVersion = '4.0.1' - localstackVersion = '0.2.6' + localstackVersion = '0.2.11' log4jVersion = '2.14.1' - springCloudAwsVersion = '2.3.0' - springIntegrationVersion = '5.5.0-SNAPSHOT' - kinesisClientVersion = '1.14.0' - kinesisProducerVersion = '0.14.3' + springCloudAwsVersion = '2.3.1' + springIntegrationVersion = '5.5.0' + kinesisClientVersion = '1.14.3' + kinesisProducerVersion = '0.14.6' idPrefix = 'aws' @@ -98,7 +98,7 @@ jacoco { checkstyle { configDirectory.set(rootProject.file("src/checkstyle")) - toolVersion = '8.39' + toolVersion = '8.42' } dependencies { diff --git a/src/main/java/org/springframework/integration/aws/inbound/S3InboundFileSynchronizer.java b/src/main/java/org/springframework/integration/aws/inbound/S3InboundFileSynchronizer.java index dbce24a..0175c0f 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/S3InboundFileSynchronizer.java +++ b/src/main/java/org/springframework/integration/aws/inbound/S3InboundFileSynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.integration.aws.inbound; import java.io.File; import java.io.IOException; +import org.springframework.expression.EvaluationContext; import org.springframework.expression.common.LiteralExpression; import org.springframework.integration.aws.support.S3Session; import org.springframework.integration.aws.support.S3SessionFactory; @@ -27,6 +28,7 @@ import org.springframework.integration.file.remote.session.Session; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer; import org.springframework.integration.metadata.SimpleMetadataStore; +import org.springframework.lang.Nullable; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.S3ObjectSummary; @@ -73,11 +75,12 @@ public class S3InboundFileSynchronizer extends AbstractInboundFileSynchronizer session) throws IOException { return super.copyFileToLocalDirectory(((S3Session) session).normalizeBucketName(remoteDirectoryPath), - remoteFile, localDirectory, session); + localFileEvaluationContext, remoteFile, localDirectory, session); } @Override diff --git a/src/test/java/org/springframework/integration/aws/config/xml/S3InboundChannelAdapterParserTests.java b/src/test/java/org/springframework/integration/aws/config/xml/S3InboundChannelAdapterParserTests.java index 6eff4f3..1949200 100644 --- a/src/test/java/org/springframework/integration/aws/config/xml/S3InboundChannelAdapterParserTests.java +++ b/src/test/java/org/springframework/integration/aws/config/xml/S3InboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,11 @@ import java.util.concurrent.atomic.AtomicReference; import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.expression.BeanFactoryResolver; import org.springframework.expression.Expression; +import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.integration.aws.inbound.S3InboundFileSynchronizer; import org.springframework.integration.aws.inbound.S3InboundFileSynchronizingMessageSource; import org.springframework.integration.aws.support.filters.S3PersistentAcceptOnceFileListFilter; @@ -54,6 +57,9 @@ import org.springframework.util.ReflectionUtils; @DirtiesContext class S3InboundChannelAdapterParserTests { + @Autowired + private BeanFactory beanFactory; + @Autowired private SourcePollingChannelAdapter s3Inbound; @@ -117,7 +123,9 @@ class S3InboundChannelAdapterParserTests { genMethod.set(method); } }); - assertThat(genMethod.get().invoke(fisync, "foo")).isEqualTo("FOO.afoo"); + StandardEvaluationContext standardEvaluationContext = new StandardEvaluationContext(); + standardEvaluationContext.setBeanResolver(new BeanFactoryResolver(this.beanFactory)); + assertThat(genMethod.get().invoke(fisync, "foo", standardEvaluationContext)).isEqualTo("FOO.afoo"); } }