use of org.springframework.integration.aws.support.filters.S3PersistentAcceptOnceFileListFilter in project spring-integration-aws by spring-projects.
the class S3StreamingInboundChannelAdapterParserTests method testS3StreamingInboundChannelAdapterComplete.
@Test
public void testS3StreamingInboundChannelAdapterComplete() throws Exception {
assertThat(TestUtils.getPropertyValue(this.s3Inbound, "autoStartup", Boolean.class)).isFalse();
assertThat(this.s3Inbound.getComponentName()).isEqualTo("s3Inbound");
assertThat(this.s3Inbound.getComponentType()).isEqualTo("aws:s3-inbound-streaming-channel-adapter");
assertThat(TestUtils.getPropertyValue(this.s3Inbound, "outputChannel")).isSameAs(this.s3Channel);
S3StreamingMessageSource source = TestUtils.getPropertyValue(this.s3Inbound, "source", S3StreamingMessageSource.class);
assertThat(TestUtils.getPropertyValue(source, "remoteDirectoryExpression", Expression.class).getExpressionString()).isEqualTo("foo/bar");
assertThat(TestUtils.getPropertyValue(source, "comparator")).isSameAs(this.comparator);
String remoteFileSeparator = (String) TestUtils.getPropertyValue(source, "remoteFileSeparator");
assertThat(remoteFileSeparator).isNotNull();
assertThat(remoteFileSeparator).isEqualTo("\\");
S3PersistentAcceptOnceFileListFilter filter = TestUtils.getPropertyValue(source, "filter", S3PersistentAcceptOnceFileListFilter.class);
assertThat(filter).isSameAs(this.acceptOnceFilter);
assertThat(TestUtils.getPropertyValue(source, "remoteFileTemplate.sessionFactory")).isSameAs(this.s3SessionFactory);
final AtomicReference<Method> genMethod = new AtomicReference<Method>();
ReflectionUtils.doWithMethods(AbstractInboundFileSynchronizer.class, new ReflectionUtils.MethodCallback() {
@Override
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
if ("generateLocalFileName".equals(method.getName())) {
method.setAccessible(true);
genMethod.set(method);
}
}
});
}
Aggregations