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-resources-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new ef79973 JUnit Jupiter best practices (#427)
ef79973 is described below
commit ef7997318c32ffa848a3e35f58f526965e5e2541
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 4 02:53:55 2025 +0100
JUnit Jupiter best practices (#427)
Co-authored-by: Moderne <[email protected]>
---
.../plugins/resources/BasicPropertyUtilsTest.java | 10 +++----
.../plugins/resources/CopyResourcesMojoTest.java | 4 +--
.../resources/PropertyUtilsExceptionTest.java | 4 +--
.../maven/plugins/resources/ResourcesMojoTest.java | 34 +++++++++++-----------
.../maven/plugins/resources/TestResourcesTest.java | 6 ++--
5 files changed, 29 insertions(+), 29 deletions(-)
diff --git
a/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java
b/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java
index 72aa6e0..320fbc2 100644
---
a/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java
+++
b/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java
@@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@MojoTest
-public class BasicPropertyUtilsTest extends AbstractPropertyUtilsTest {
+class BasicPropertyUtilsTest extends AbstractPropertyUtilsTest {
protected static final String VALIDATION_FILE_NAME =
"target/test-classes/unit/propertiesutils-test/basic_validation.properties";
@@ -65,7 +65,7 @@ public class BasicPropertyUtilsTest extends
AbstractPropertyUtilsTest {
* @throws Exception
*/
@Test
- public void testBasicLoadPropertyFF() throws Exception {
+ void basicLoadPropertyFF() throws Exception {
Properties prop = PropertyUtils.loadPropertyFile(propertyFile, false,
false);
assertNotNull(prop);
@@ -78,7 +78,7 @@ public class BasicPropertyUtilsTest extends
AbstractPropertyUtilsTest {
* @throws Exception
*/
@Test
- public void testBasicLoadPropertyTF() throws Exception {
+ void basicLoadPropertyTF() throws Exception {
Properties prop = PropertyUtils.loadPropertyFile(propertyFile, true,
false);
assertNotNull(prop);
@@ -91,7 +91,7 @@ public class BasicPropertyUtilsTest extends
AbstractPropertyUtilsTest {
* @throws Exception
*/
@Test
- public void testBasicLoadPropertyTT() throws Exception {
+ void basicLoadPropertyTT() throws Exception {
Properties prop = PropertyUtils.loadPropertyFile(propertyFile, true,
true);
validationProp.putAll(System.getProperties());
@@ -105,7 +105,7 @@ public class BasicPropertyUtilsTest extends
AbstractPropertyUtilsTest {
* @throws Exception
*/
@Test
- public void testNonExistentProperty() throws Exception {
+ void nonExistentProperty() throws Exception {
Properties prop = PropertyUtils.loadPropertyFile(propertyFile, true,
true);
validationProp.putAll(System.getProperties());
diff --git
a/src/test/java/org/apache/maven/plugins/resources/CopyResourcesMojoTest.java
b/src/test/java/org/apache/maven/plugins/resources/CopyResourcesMojoTest.java
index 718087a..fdc45c0 100644
---
a/src/test/java/org/apache/maven/plugins/resources/CopyResourcesMojoTest.java
+++
b/src/test/java/org/apache/maven/plugins/resources/CopyResourcesMojoTest.java
@@ -44,12 +44,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* @version $Id$
*/
@MojoTest
-public class CopyResourcesMojoTest {
+class CopyResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom =
"classpath:/unit/resources-test/plugin-config.xml")
@Basedir
- public void testCopyWithoutFiltering(ResourcesMojo mojo) throws Exception {
+ void copyWithoutFiltering(ResourcesMojo mojo) throws Exception {
Resource resource = new Resource();
resource.setDirectory(getPluginBasedir() +
"/src/test/unit-files/copy-resources-test/no-filter");
resource.setFiltering(false);
diff --git
a/src/test/java/org/apache/maven/plugins/resources/PropertyUtilsExceptionTest.java
b/src/test/java/org/apache/maven/plugins/resources/PropertyUtilsExceptionTest.java
index 915e084..3e5085c 100644
---
a/src/test/java/org/apache/maven/plugins/resources/PropertyUtilsExceptionTest.java
+++
b/src/test/java/org/apache/maven/plugins/resources/PropertyUtilsExceptionTest.java
@@ -26,13 +26,13 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
-public class PropertyUtilsExceptionTest {
+class PropertyUtilsExceptionTest {
/**
* load property test case can be adjusted by modifying the
basic.properties and basic_validation properties
*/
@Test
- public void loadPropertyFileShouldFailWithFileNotFoundException() {
+ void loadPropertyFileShouldFailWithFileNotFoundException() {
assertThrows(
FileNotFoundException.class,
() ->
PropertyUtils.loadPropertyFile(Paths.get("NON_EXISTENT_FILE"), true, true));
diff --git
a/src/test/java/org/apache/maven/plugins/resources/ResourcesMojoTest.java
b/src/test/java/org/apache/maven/plugins/resources/ResourcesMojoTest.java
index 8f0263e..67a04b4 100644
--- a/src/test/java/org/apache/maven/plugins/resources/ResourcesMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/resources/ResourcesMojoTest.java
@@ -49,7 +49,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@MojoTest
-public class ResourcesMojoTest {
+class ResourcesMojoTest {
private static final String CONFIG_XML =
"classpath:/unit/resources-test/plugin-config.xml";
@@ -59,7 +59,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testHarnessEnvironment(ResourcesMojo mojo) {
+ void harnessEnvironment(ResourcesMojo mojo) {
assertNotNull(mojo);
}
@@ -68,7 +68,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceDirectoryStructure(ResourcesMojo mojo) throws
Exception {
+ void resourceDirectoryStructure(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -101,7 +101,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceDirectoryStructureRelativePath(ResourcesMojo mojo)
throws Exception {
+ void resourceDirectoryStructureRelativePath(ResourcesMojo mojo) throws
Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -135,7 +135,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceEncoding(ResourcesMojo mojo) throws Exception {
+ void resourceEncoding(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -162,7 +162,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceInclude(ResourcesMojo mojo) throws Exception {
+ void resourceInclude(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -211,7 +211,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceExclude(ResourcesMojo mojo) throws Exception {
+ void resourceExclude(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -261,7 +261,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceTargetPath(ResourcesMojo mojo) throws Exception {
+ void resourceTargetPath(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -296,7 +296,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceSystemPropertiesFiltering(ResourcesMojo mojo)
throws Exception {
+ void resourceSystemPropertiesFiltering(ResourcesMojo mojo) throws
Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -337,7 +337,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testResourceProjectPropertiesFiltering(ResourcesMojo mojo)
throws Exception {
+ void resourceProjectPropertiesFiltering(ResourcesMojo mojo) throws
Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -366,7 +366,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testProjectPropertyFilteringPropertyDestination(ResourcesMojo
mojo) throws Exception {
+ void projectPropertyFilteringPropertyDestination(ResourcesMojo mojo)
throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -398,7 +398,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testPropertyFilesFiltering(ResourcesMojo mojo) throws
Exception {
+ void propertyFilesFiltering(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -430,7 +430,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testPropertyFilesExtra(ResourcesMojo mojo) throws Exception {
+ void propertyFilesExtra(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -462,7 +462,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testPropertyFilesMainAndExtra(ResourcesMojo mojo) throws
Exception {
+ void propertyFilesMainAndExtra(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -505,7 +505,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testPropertyFilesFilteringTokensInFilters(ResourcesMojo mojo)
throws Exception {
+ void propertyFilesFilteringTokensInFilters(ResourcesMojo mojo) throws
Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -536,7 +536,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testWindowsPathEscapingDisabled(ResourcesMojo mojo) throws
Exception {
+ void windowsPathEscapingDisabled(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
@@ -571,7 +571,7 @@ public class ResourcesMojoTest {
@Test
@InjectMojo(goal = "resources", pom = CONFIG_XML)
@Basedir
- public void testWindowsPathEscapingEnabled(ResourcesMojo mojo) throws
Exception {
+ void windowsPathEscapingEnabled(ResourcesMojo mojo) throws Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;
diff --git
a/src/test/java/org/apache/maven/plugins/resources/TestResourcesTest.java
b/src/test/java/org/apache/maven/plugins/resources/TestResourcesTest.java
index 0697878..189ea50 100644
--- a/src/test/java/org/apache/maven/plugins/resources/TestResourcesTest.java
+++ b/src/test/java/org/apache/maven/plugins/resources/TestResourcesTest.java
@@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@MojoTest
-public class TestResourcesTest {
+class TestResourcesTest {
private static final String CONFIG_XML =
"classpath:/unit/resources-test/plugin-config.xml";
/**
@@ -50,7 +50,7 @@ public class TestResourcesTest {
@Test
@InjectMojo(goal = "testResources", pom = CONFIG_XML)
@Basedir
- public void testHarnessEnvironment(TestResourcesMojo mojo) {
+ void harnessEnvironment(TestResourcesMojo mojo) {
assertNotNull(mojo);
}
@@ -59,7 +59,7 @@ public class TestResourcesTest {
@Test
@InjectMojo(goal = "testResources", pom = CONFIG_XML)
@Basedir
- public void testTestResourceDirectoryCreation(TestResourcesMojo mojo)
throws Exception {
+ void testResourceDirectoryCreation(TestResourcesMojo mojo) throws
Exception {
assertNotNull(mojo);
MavenProjectResourcesStub project = (MavenProjectResourcesStub)
mojo.project;