peterdemaeyer commented on code in PR #60:
URL: https://github.com/apache/maven-clean-plugin/pull/60#discussion_r1833240861


##########
src/test/java/org/apache/maven/plugins/clean/CleanerTest.java:
##########
@@ -45,36 +42,22 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
 import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 class CleanerTest {
 
-    private boolean warnEnabled;
-
-    /**
-     * Use a {@code LinkedHashMap} to preserve the order of the logged 
warnings.
-     */
-    private final Map<CharSequence, Throwable> warnings = new 
LinkedHashMap<>();
-
-    /**
-     * Ideally we should use a mocking framework such as Mockito for this, but 
alas, this project has no such dependency.
-     */
-    private final Log log = new SilentLog() {
-
-        @Override
-        public boolean isWarnEnabled() {
-            return warnEnabled;
-        }
-
-        @Override
-        public void warn(CharSequence content, Throwable error) {
-            warnings.put(content, error);
-        }
-    };
+    private final Log log = mock();
 
     @Test
     void deleteSucceedsDeeply(@TempDir Path tempDir) throws Exception {
-        final Path basedir = createDirectory(tempDir.resolve("target"));
+        final Path basedir = 
createDirectory(tempDir.resolve("target")).toRealPath();

Review Comment:
   No, I disabled the tests on non-POSIX-compliant OSes using JUnit 5 
`Assumptions`. I deemed it acceptable, because this is not a test for specific 
features and failures on all OSes, it's a test for `Cleaner` providing it with 
a variety of failures. It doesn't matter if these failure are exactly the same 
on all OSes, as long as there is at least _one_ POSIX-compliant OS in the test 
suite, which is the case, it's enough to cover the feature.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to