This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-clean-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 9c12070 JUnit Jupiter best practices (#279)
9c12070 is described below
commit 9c120700ea6782f0886f63fbea7f71e32bf75d66
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Fri Nov 7 08:47:06 2025 +0100
JUnit Jupiter best practices (#279)
Co-authored-by: Moderne <[email protected]>
---
.../apache/maven/plugins/clean/CleanMojoTest.java | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java
b/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java
index 967edce..3f0f7cd 100644
--- a/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java
@@ -51,7 +51,7 @@ import static org.mockito.Mockito.mock;
* Test the clean mojo.
*/
@MojoTest
-public class CleanMojoTest {
+class CleanMojoTest {
private final Log log = mock(Log.class);
@@ -63,7 +63,7 @@ public class CleanMojoTest {
@Test
@Basedir("${basedir}/target/test-classes/unit/basic-clean-test")
@InjectMojo(goal = "clean")
- public void testBasicClean(CleanMojo mojo) throws Exception {
+ void basicClean(CleanMojo mojo) throws Exception {
mojo.execute();
assertFalse(checkExists(getBasedir() + "/buildDirectory"), "Directory
exists");
@@ -79,7 +79,7 @@ public class CleanMojoTest {
@Test
@Basedir("${basedir}/target/test-classes/unit/nested-clean-test")
@InjectMojo(goal = "clean")
- public void testCleanNestedStructure(CleanMojo mojo) throws Exception {
+ void cleanNestedStructure(CleanMojo mojo) throws Exception {
mojo.execute();
assertFalse(checkExists(getBasedir() + "/target"));
@@ -96,7 +96,7 @@ public class CleanMojoTest {
@Test
@Basedir("${basedir}/target/test-classes/unit/empty-clean-test")
@InjectMojo(goal = "clean")
- public void testCleanEmptyDirectories(CleanMojo mojo) throws Exception {
+ void cleanEmptyDirectories(CleanMojo mojo) throws Exception {
mojo.execute();
assertTrue(checkExists(getBasedir() + "/testDirectoryStructure"));
@@ -113,7 +113,7 @@ public class CleanMojoTest {
@Test
@Basedir("${basedir}/target/test-classes/unit/fileset-clean-test")
@InjectMojo(goal = "clean")
- public void testFilesetsClean(CleanMojo mojo) throws Exception {
+ void filesetsClean(CleanMojo mojo) throws Exception {
mojo.execute();
// fileset 1
@@ -139,7 +139,7 @@ public class CleanMojoTest {
@Test
@Basedir("${basedir}/target/test-classes/unit/invalid-directory-test")
@InjectMojo(goal = "clean")
- public void testCleanInvalidDirectory(CleanMojo mojo) throws Exception {
+ void cleanInvalidDirectory(CleanMojo mojo) throws Exception {
assertThrows(MojoException.class, mojo::execute, "Should fail to
delete a file treated as a directory");
}
@@ -151,7 +151,7 @@ public class CleanMojoTest {
@Test
@Basedir("${basedir}/target/test-classes/unit/missing-directory-test")
@InjectMojo(goal = "clean")
- public void testMissingDirectory(CleanMojo mojo) throws Exception {
+ void missingDirectory(CleanMojo mojo) throws Exception {
mojo.execute();
assertFalse(checkExists(getBasedir() + "/does-not-exist"));
@@ -169,7 +169,7 @@ public class CleanMojoTest {
@EnabledOnOs(OS.WINDOWS)
@Basedir("${basedir}/target/test-classes/unit/locked-file-test")
@InjectMojo(goal = "clean")
- public void testCleanLockedFile(CleanMojo mojo) throws Exception {
+ void cleanLockedFile(CleanMojo mojo) throws Exception {
File f = new File(getBasedir(), "buildDirectory/file.txt");
try (FileChannel channel = new RandomAccessFile(f, "rw").getChannel();
FileLock ignored = channel.lock()) {
@@ -189,7 +189,7 @@ public class CleanMojoTest {
@EnabledOnOs(OS.WINDOWS)
@Basedir("${basedir}/target/test-classes/unit/locked-file-test")
@InjectMojo(goal = "clean")
- public void testCleanLockedFileWithNoError(CleanMojo mojo) throws
Exception {
+ void cleanLockedFileWithNoError(CleanMojo mojo) throws Exception {
setVariableValueToObject(mojo, "failOnError", Boolean.FALSE);
assertNotNull(mojo);
@@ -206,7 +206,7 @@ public class CleanMojoTest {
*/
@Test
@EnabledOnOs(OS.WINDOWS)
- public void testFollowLinksWithWindowsJunction() throws Exception {
+ void followLinksWithWindowsJunction() throws Exception {
testSymlink((link, target) -> {
Process process = new ProcessBuilder()
.directory(link.getParent().toFile())
@@ -228,7 +228,7 @@ public class CleanMojoTest {
*/
@Test
@DisabledOnOs(OS.WINDOWS)
- public void testFollowLinksWithSymLinkOnPosix() throws Exception {
+ void followLinksWithSymLinkOnPosix() throws Exception {
testSymlink((link, target) -> {
try {
Files.createSymbolicLink(link, target);