Modernize temp file creation and deletion in DeferredFileOutputStreamTest#535
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #535 +/- ##
=========================================
Coverage 85.97% 85.97%
Complexity 3461 3461
=========================================
Files 229 229
Lines 8191 8191
Branches 959 959
=========================================
Hits 7042 7042
Misses 861 861
Partials 288 288 ☔ View full report in Codecov by Sentry. |
|
Toward this type of effort, I refactored some tests a while back to extend |
|
Thanks. I'll look at that. The one test failure on CI looks unrelated: Error: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy (default-deploy) on project commons-io: Failed to deploy artifacts: Could not transfer artifact commons-io:commons-io:pom:2.16.0-20231224.153125-11 from/to apache.snapshots.https (https://repository.apache.org/content/repositories/snapshots): authentication failed for https://repository.apache.org/content/repositories/snapshots/commons-io/commons-io/2.16.0-SNAPSHOT/commons-io-2.16.0-20231224.153125-11.pom, status: 401 Unauthorized -> [Help 1] |
While experimenting I broke some things, and consequently failing tests left some untracked temporary files scattered around my git repo. This PR uses try-with-resources, JUnit 5's @tempdir, and Java 7 Files.createTempFile to more reliably cleanup after test failures.
@garydgregory