Various tests fixes
* Use a tmp file in the `FileTests.testFileReadingFlow()` for writing content and then rename it to the target file. It looks like we may already have a file just with a short content and it is picked up by the watch service for processing in the flow * Rework `AggregatorWithCustomReleaseStrategyTests` to JUnit 5 and remove extra looping logic since it just does not add any extra coverage just performance overhead via crating and destroying the same application ctx * Rework `ChannelAdapterParserTests` to `@SpringJUnitConfig` managed test
This commit is contained in:
@@ -201,10 +201,12 @@ public class FileTests {
|
||||
if (even) {
|
||||
evens.add(i);
|
||||
}
|
||||
FileOutputStream file = new FileOutputStream(new File(tmpDir, i + extension));
|
||||
file.write(("" + i).getBytes());
|
||||
file.flush();
|
||||
file.close();
|
||||
File tmpFile = new File(tmpDir, i + extension + ".tmp");
|
||||
FileOutputStream stream = new FileOutputStream(tmpFile);
|
||||
stream.write(("" + i).getBytes());
|
||||
stream.flush();
|
||||
stream.close();
|
||||
tmpFile.renameTo(new File(tmpDir, i + extension));
|
||||
}
|
||||
|
||||
Message<?> message = fileReadingResultChannel.receive(60000);
|
||||
|
||||
Reference in New Issue
Block a user