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-file-management.git
The following commit(s) were added to refs/heads/master by this push:
new c606675 JUnit Jupiter best practices (#101)
c606675 is described below
commit c6066750c2a16e1d5d886578df9b46784116ca50
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 4 03:02:20 2025 +0100
JUnit Jupiter best practices (#101)
Co-authored-by: Moderne <[email protected]>
---
.../model/fileset/mappers/MapperUtilTest.java | 10 +++++-----
.../model/fileset/util/FileSetUtilsTest.java | 22 +++++++++++-----------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git
a/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
b/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
index 1daa9d2..f84562c 100644
---
a/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
+++
b/src/test/java/org/apache/maven/shared/model/fileset/mappers/MapperUtilTest.java
@@ -28,14 +28,14 @@ import static org.junit.jupiter.api.Assertions.assertNull;
/**
* A test-case for the MapperUtil.
*/
-public class MapperUtilTest {
+class MapperUtilTest {
@Test
- void getFileNameMapperShouldReturnNull() throws MapperException {
+ void getFileNameMapperShouldReturnNull() throws Exception {
assertNull(MapperUtil.getFileNameMapper(null));
}
@Test
- void getFileNameMapperShouldReturnIdentityMapper() throws MapperException {
+ void getFileNameMapperShouldReturnIdentityMapper() throws Exception {
Mapper mapper = new Mapper();
FileNameMapper fileNameMapper = MapperUtil.getFileNameMapper(mapper);
assertNotNull(fileNameMapper);
@@ -43,7 +43,7 @@ public class MapperUtilTest {
}
@Test
- void getFileNameMapperShouldFileNameMapperType() throws MapperException {
+ void getFileNameMapperShouldFileNameMapperType() throws Exception {
// check with FileNameMapper type
Mapper mapper = new Mapper();
mapper.setType("glob");
@@ -55,7 +55,7 @@ public class MapperUtilTest {
}
@Test
- void testGetFileNameMapper() throws MapperException {
+ void getFileNameMapper() throws Exception {
Mapper mapper = new Mapper();
mapper.setType("glob");
mapper.setFrom("*.java");
diff --git
a/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
b/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
index 6192df0..ade0f8e 100644
---
a/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
+++
b/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
@@ -38,7 +38,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
/**
* Test the FileSet
*/
-public class FileSetUtilsTest {
+class FileSetUtilsTest {
@TempDir
File testDirectory;
@@ -46,7 +46,7 @@ public class FileSetUtilsTest {
* @throws IOException if any
*/
@Test
- void testGetIncludedFiles() throws IOException {
+ void getIncludedFiles() throws Exception {
File directory = setupTestDirectory("testGetIncludedFiles");
FileSet set = new FileSet();
@@ -61,7 +61,7 @@ public class FileSetUtilsTest {
}
@Test
- void testIncludesDontFollowSymlinks() throws IOException {
+ void includesDontFollowSymlinks() throws Exception {
File directory = setupTestDirectory("testIncludesDontFollowSymlinks");
File subdir = new File(directory, directory.getName());
@@ -80,7 +80,7 @@ public class FileSetUtilsTest {
}
@Test
- void testDeleteDontFollowSymlinks() throws IOException {
+ void deleteDontFollowSymlinks() throws Exception {
File directory = setupTestDirectory("testDeleteDontFollowSymlinks");
File subdir = new File(directory, directory.getName());
@@ -103,7 +103,7 @@ public class FileSetUtilsTest {
* @throws IOException if any
*/
@Test
- void testDelete() throws IOException {
+ void delete() throws Exception {
File directory = setupTestDirectory("testDelete");
File subdirFile = new File(directory, "subdir/excluded.txt");
@@ -123,7 +123,7 @@ public class FileSetUtilsTest {
* @throws Exception if any
*/
@Test
- void testDeleteDanglingSymlink() throws Exception {
+ void deleteDanglingSymlink() throws Exception {
File directory = setupTestDirectory("testDeleteDanglingSymlink");
File targetFile = new File(directory, "test.txt");
File linkFile = new File(directory, "symlink");
@@ -147,7 +147,7 @@ public class FileSetUtilsTest {
* @throws Exception if any
*/
@Test
- void testDeleteExcludeParentOfExcludedFile() throws Exception {
+ void deleteExcludeParentOfExcludedFile() throws Exception {
File directory =
setupTestDirectory("testDeleteExcludeParentOfExcludedFile");
FileSet set = new FileSet();
@@ -166,7 +166,7 @@ public class FileSetUtilsTest {
* @throws Exception if any
*/
@Test
- void testDeleteExcludeParentOfExcludedDir() throws Exception {
+ void deleteExcludeParentOfExcludedDir() throws Exception {
File directory =
setupTestDirectory("testDeleteExcludeParentOfExcludedDir");
FileSet set = new FileSet();
@@ -185,7 +185,7 @@ public class FileSetUtilsTest {
* @throws Exception if any
*/
@Test
- void testDeleteExcludeFollowSymlinks() throws Exception {
+ void deleteExcludeFollowSymlinks() throws Exception {
File directory = setupTestDirectory("testDeleteExcludeFollowSymlinks");
FileSet set = new FileSet();
@@ -206,7 +206,7 @@ public class FileSetUtilsTest {
* @throws Exception if any
*/
@Test
- void testDeleteExcludeDontFollowSymlinks() throws Exception {
+ void deleteExcludeDontFollowSymlinks() throws Exception {
File directory =
setupTestDirectory("testDeleteExcludeDontFollowSymlinks");
FileSet set = new FileSet();
@@ -224,7 +224,7 @@ public class FileSetUtilsTest {
}
@Test
- void testDeleteDontFollowSymlinksButDeleteThem() throws Exception {
+ void deleteDontFollowSymlinksButDeleteThem() throws Exception {
File directory =
setupTestDirectory("testDeleteDontFollowSymlinksButDeleteThem");
createSymlink(new File(directory, "excluded"), new File(directory,
"dirlink"));