Commit ac77fc9d authored by Andy Wilkinson's avatar Andy Wilkinson

Ignore .writing files in Integration samples tests

Previously, a temporary .writing file could be found and an attempt made to
access its contents. If the temporary file was deleted between it being found
and its contents being read, the test would fail with a FileNotFoundException.

This commit updates the test to ignore .writing files so that it will only
examine the contents of the final file once Integration has finished
writing it an atomically moved it to its final location.
parent f6a22a05
......@@ -113,7 +113,9 @@ public class SampleIntegrationApplicationTests {
.getResourcePatternResolver(new DefaultResourceLoader())
.getResources("file:target/output/**");
for (Resource candidate : candidates) {
if (candidate.contentLength() == 0) {
if ((candidate.getFilename() != null
&& candidate.getFilename().endsWith(".writing"))
|| candidate.contentLength() == 0) {
return new Resource[0];
}
}
......
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