Commit c346e996 authored by Andy Wilkinson's avatar Andy Wilkinson

Ignore temporary .writing files when finding output files

Spring Integration's FileWritingMessageHandler uses a .writing file
while it's in the process of writing a message to disk and then
performs a rename (depending on the OS and filesystem this may or may
not be atommic) to create the .msg file. Prior to this commit the
test was finding the temporary .writing files and examining them. This
could lead to a FileNotFoundException being thrown as the temporary
file was deleted while the test was trying to read its contents.

This commit updates the test to only look for files with a .msg suffix

Fixes gh-2428
parent c3020e9e
......@@ -87,7 +87,7 @@ public class SampleIntegrationParentApplicationTests {
private Resource[] findResources() throws IOException {
return ResourcePatternUtils.getResourcePatternResolver(
new DefaultResourceLoader()).getResources("file:target/output/**");
new DefaultResourceLoader()).getResources("file:target/output/**/*.msg");
}
private String readResources(Resource[] resources) throws IOException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment