Upgrade dependencies; fix compatibility; release
This commit is contained in:
@@ -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<S
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean copyFileToLocalDirectory(String remoteDirectoryPath, S3ObjectSummary remoteFile,
|
||||
protected boolean copyFileToLocalDirectory(String remoteDirectoryPath,
|
||||
@Nullable EvaluationContext localFileEvaluationContext, S3ObjectSummary remoteFile,
|
||||
File localDirectory, Session<S3ObjectSummary> session) throws IOException {
|
||||
|
||||
return super.copyFileToLocalDirectory(((S3Session) session).normalizeBucketName(remoteDirectoryPath),
|
||||
remoteFile, localDirectory, session);
|
||||
localFileEvaluationContext, remoteFile, localDirectory, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user