Skip to content

Commit

Permalink
Closing MockedStatic on each test
Browse files Browse the repository at this point in the history
  • Loading branch information
fbelzunc committed Dec 16, 2022
1 parent a5265d0 commit 1b3f536
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public void logFileProperlyRotatingInNextDayWithDailyRotation() throws IOExcepti
log = Util.loadFile(logFileRotating.toFile(), StandardCharsets.UTF_8);
Assert.assertTrue(log.contains("configuringAFileLoggerRotatingDaily - line2"));
Assert.assertFalse(log.contains("configuringAFileLoggerRotatingDaily - line1"));

mockedLocalDateTime.close();
}

/**
Expand Down Expand Up @@ -170,5 +172,7 @@ public void oldLogFilesProperlyRemovedWithDailyRotation() throws IOException {
String directoryPath = logFile.toFile().getParent();
Collection<File> directoryFiles = FileUtils.listFiles(new File(directoryPath), new RegexFileFilter(".*" + logFile.toFile().getName() + LogFileAuditLogger.DAILY_ROTATING_FILE_REGEX_PATTERN), DirectoryFileFilter.DIRECTORY);
Assert.assertEquals(directoryFiles.size(),2);

mockedLocalDateTime.close();
}
}

0 comments on commit 1b3f536

Please sign in to comment.