use of org.springframework.integration.file.DefaultFileNameGenerator in project spring-integration by spring-projects.
the class FtpOutboundChannelAdapterParserTests method testBeanExpressions.
@Test
public void testBeanExpressions() throws Exception {
FileTransferringMessageHandler<?> handler = TestUtils.getPropertyValue(withBeanExpressions, "handler", FileTransferringMessageHandler.class);
ExpressionEvaluatingMessageProcessor<?> dirExpProc = TestUtils.getPropertyValue(handler, "remoteFileTemplate.directoryExpressionProcessor", ExpressionEvaluatingMessageProcessor.class);
assertNotNull(dirExpProc);
Message<String> message = MessageBuilder.withPayload("qux").build();
assertEquals("foo", dirExpProc.processMessage(message));
ExpressionEvaluatingMessageProcessor<?> tempDirExpProc = TestUtils.getPropertyValue(handler, "remoteFileTemplate.temporaryDirectoryExpressionProcessor", ExpressionEvaluatingMessageProcessor.class);
assertNotNull(tempDirExpProc);
assertEquals("bar", tempDirExpProc.processMessage(message));
DefaultFileNameGenerator generator = TestUtils.getPropertyValue(handler, "remoteFileTemplate.fileNameGenerator", DefaultFileNameGenerator.class);
assertNotNull(generator);
assertEquals("baz", generator.generateFileName(message));
}
Aggregations