This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch maven-clean-plugin-4.x in repository https://gitbox.apache.org/repos/asf/maven-clean-plugin.git
commit 47b5ea3a430f66317f0efb6abd9a7c91211ac606 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Tue Nov 17 03:07:51 2026 +0000 Use JUnit 5 assertions and Mockito best practices in tests --- .../org/apache/maven/plugins/clean/BackgroundCleanerTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/clean/BackgroundCleanerTest.java b/src/test/java/org/apache/maven/plugins/clean/BackgroundCleanerTest.java index cd37bd9..89d7cf5 100644 --- a/src/test/java/org/apache/maven/plugins/clean/BackgroundCleanerTest.java +++ b/src/test/java/org/apache/maven/plugins/clean/BackgroundCleanerTest.java @@ -123,7 +123,7 @@ class BackgroundCleanerTest { * return the same instance (session-scoped singleton). */ @Test - void getOrCreateReturnsSameInstance(@TempDir Path tempDir) throws IOException { + void getOrCreateReturnsSameInstance(@TempDir Path tempDir) throws Exception { Path fastDir = tempDir.resolve(".clean"); Log log = mock(Log.class); ArgumentCaptor<Listener> captor = ArgumentCaptor.forClass(Listener.class); @@ -142,7 +142,7 @@ class BackgroundCleanerTest { * {@code fastMode}, a warn-level message must be emitted (first-wins semantics). */ @Test - void getOrCreateLogsWarnOnConfigMismatch(@TempDir Path tempDir) throws IOException { + void getOrCreateLogsWarnOnConfigMismatch(@TempDir Path tempDir) throws Exception { Path fastDir = tempDir.resolve(".clean"); Log log = mock(Log.class); Session session = mockSession(null); @@ -159,7 +159,7 @@ class BackgroundCleanerTest { * parameters, no warn message about a mismatch must be emitted. */ @Test - void getOrCreateNoWarnWhenSameConfig(@TempDir Path tempDir) throws IOException { + void getOrCreateNoWarnWhenSameConfig(@TempDir Path tempDir) throws Exception { Path fastDir = tempDir.resolve(".clean"); Log log = mock(Log.class); Session session = mockSession(null); @@ -334,7 +334,7 @@ class BackgroundCleanerTest { * and the constructor must complete normally. */ @Test - void scanForLeftoversIsNoOpWhenFastDirAbsent(@TempDir Path tempDir) throws IOException { + void scanForLeftoversIsNoOpWhenFastDirAbsent(@TempDir Path tempDir) throws Exception { Path fastDir = tempDir.resolve(".clean"); // does NOT exist Log log = mock(Log.class); Session session = mockSession(null);
