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-install-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new b752ac6 JUnit Jupiter best practices (#370)
b752ac6 is described below
commit b752ac6a0428e780d5c9fcccd117f6a77945025e
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sun Nov 9 15:35:38 2025 +0100
JUnit Jupiter best practices (#370)
Co-authored-by: Moderne <[email protected]>
---
.../maven/plugins/install/InstallFileMojoTest.java | 20 ++++++++++----------
.../plugins/install/InstallMojoPomPackagingTest.java | 6 +++---
.../maven/plugins/install/InstallMojoTest.java | 14 +++++++-------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git
a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
index 79232ef..6ce89f9 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java
@@ -68,7 +68,7 @@ import static org.mockito.Mockito.when;
* @author <a href="mailto:[email protected]">Allan Ramirez</a>
*/
@MojoTest
-public class InstallFileMojoTest {
+class InstallFileMojoTest {
private static final String LOCAL_REPO = "target/local-repo";
private String groupId;
@@ -88,7 +88,7 @@ public class InstallFileMojoTest {
ArtifactInstaller artifactInstaller;
@BeforeEach
- public void setUp() throws Exception {
+ void setUp() throws Exception {
FileUtils.deleteDirectory(new File(getBasedir() + "/" + LOCAL_REPO));
}
@@ -101,7 +101,7 @@ public class InstallFileMojoTest {
@MojoParameter(
name = "file",
value =
"${project.basedir}/target/test-classes/unit/maven-install-test-1.0-SNAPSHOT.jar")
- public void testInstallFileTestEnvironment(InstallFileMojo mojo) {
+ void installFileTestEnvironment(InstallFileMojo mojo) {
assertNotNull(mojo);
}
@@ -114,7 +114,7 @@ public class InstallFileMojoTest {
@MojoParameter(
name = "file",
value =
"${project.basedir}/target/test-classes/unit/maven-install-test-1.0-SNAPSHOT.jar")
- public void testBasicInstallFile(InstallFileMojo mojo) throws Exception {
+ void basicInstallFile(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
@@ -141,7 +141,7 @@ public class InstallFileMojoTest {
@MojoParameter(name = "version", value = "1.0-SNAPSHOT")
@MojoParameter(name = "packaging", value = "jar")
@MojoParameter(name = "file", value =
"${project.basedir}/target/test-classes/unit/file-does-not-exist.jar")
- public void testFileDoesNotExists(InstallFileMojo mojo) throws Exception {
+ void fileDoesNotExists(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
@@ -158,7 +158,7 @@ public class InstallFileMojoTest {
@MojoParameter(
name = "file",
value =
"${project.basedir}/target/test-classes/unit/maven-install-test-1.0-SNAPSHOT.jar")
- public void testInstallFileWithClassifier(InstallFileMojo mojo) throws
Exception {
+ void installFileWithClassifier(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
assertNotNull(classifier);
@@ -188,7 +188,7 @@ public class InstallFileMojoTest {
name = "file",
value =
"${project.basedir}/target/test-classes/unit/maven-install-test-1.0-SNAPSHOT.jar")
@MojoParameter(name = "generatePom", value = "true")
- public void testInstallFileWithGeneratePom(InstallFileMojo mojo) throws
Exception {
+ void installFileWithGeneratePom(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
assertTrue((Boolean) getVariableValueFromObject(mojo, "generatePom"));
@@ -231,7 +231,7 @@ public class InstallFileMojoTest {
name = "file",
value =
"${project.basedir}/target/test-classes/unit/maven-install-test-1.0-SNAPSHOT.jar")
@MojoParameter(name = "pomFile", value =
"${project.basedir}/src/test/resources/unit/pom.xml")
- public void testInstallFileWithPomFile(InstallFileMojo mojo) throws
Exception {
+ void installFileWithPomFile(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
Path pomFile = (Path) getVariableValueFromObject(mojo, "pomFile");
@@ -257,7 +257,7 @@ public class InstallFileMojoTest {
@MojoParameter(name = "version", value = "1.0-SNAPSHOT")
@MojoParameter(name = "packaging", value = "pom")
@MojoParameter(name = "file", value =
"${project.basedir}/target/test-classes/unit/pom.xml")
- public void testInstallFileWithPomAsPackaging(InstallFileMojo mojo) throws
Exception {
+ void installFileWithPomAsPackaging(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
assertTrue(Files.exists(file));
@@ -281,7 +281,7 @@ public class InstallFileMojoTest {
name = "file",
value =
"${project.basedir}/target/test-classes/unit/maven-install-test-1.0-SNAPSHOT.jar")
@MojoParameter(name = "pomFile", value =
"${project.basedir}/target/test-classes/unit/pom.xml")
- public void testInstallFile(InstallFileMojo mojo) throws Exception {
+ void installFile(InstallFileMojo mojo) throws Exception {
assertNotNull(mojo);
assignValuesForParameter(mojo);
diff --git
a/src/test/java/org/apache/maven/plugins/install/InstallMojoPomPackagingTest.java
b/src/test/java/org/apache/maven/plugins/install/InstallMojoPomPackagingTest.java
index 732c317..9ebf2e0 100644
---
a/src/test/java/org/apache/maven/plugins/install/InstallMojoPomPackagingTest.java
+++
b/src/test/java/org/apache/maven/plugins/install/InstallMojoPomPackagingTest.java
@@ -63,7 +63,7 @@ import static org.mockito.Mockito.when;
* @author <a href="mailto:[email protected]">Allan Ramirez</a>
*/
@MojoTest
-public class InstallMojoPomPackagingTest {
+class InstallMojoPomPackagingTest {
private static final String LOCAL_REPO = "target/local-repo/";
@@ -80,14 +80,14 @@ public class InstallMojoPomPackagingTest {
ProjectManager projectManager;
@BeforeEach
- public void setUp() throws Exception {
+ void setUp() throws Exception {
FileUtils.deleteDirectory(new File(getBasedir() + "/" + LOCAL_REPO));
}
@Test
@InjectMojo(goal = "install")
@MojoParameter(name = "installAtEnd", value = "false")
- public void testInstallIfPackagingIsPom(InstallMojo mojo) throws Exception
{
+ void installIfPackagingIsPom(InstallMojo mojo) throws Exception {
assertNotNull(mojo);
Project project = (Project) getVariableValueFromObject(mojo,
"project");
String packaging = project.getPackaging().type().id();
diff --git
a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
index 66735cf..59e43ae 100644
--- a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
@@ -66,7 +66,7 @@ import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.when;
@MojoTest
-public class InstallMojoTest {
+class InstallMojoTest {
private static final String LOCAL_REPO = "target/local-repo/";
@@ -83,20 +83,20 @@ public class InstallMojoTest {
ProjectManager projectManager;
@BeforeEach
- public void setUp() throws Exception {
+ void setUp() throws Exception {
FileUtils.deleteDirectory(new File(getBasedir() + "/" + LOCAL_REPO));
}
@Test
@InjectMojo(goal = "install")
- public void testInstallTestEnvironment(InstallMojo mojo) {
+ void installTestEnvironment(InstallMojo mojo) {
assertNotNull(mojo);
}
@Test
@InjectMojo(goal = "install")
@MojoParameter(name = "installAtEnd", value = "false")
- public void testBasicInstall(InstallMojo mojo) throws Exception {
+ void basicInstall(InstallMojo mojo) throws Exception {
assertNotNull(mojo);
Project project = (Project) getVariableValueFromObject(mojo,
"project");
artifactManager.setPath(
@@ -117,7 +117,7 @@ public class InstallMojoTest {
@Test
@InjectMojo(goal = "install")
@MojoParameter(name = "installAtEnd", value = "false")
- public void testBasicInstallWithAttachedArtifacts(InstallMojo mojo) throws
Exception {
+ void basicInstallWithAttachedArtifacts(InstallMojo mojo) throws Exception {
assertNotNull(mojo);
Project project = (Project) getVariableValueFromObject(mojo,
"project");
projectManager.attachArtifact(
@@ -142,7 +142,7 @@ public class InstallMojoTest {
@Test
@InjectMojo(goal = "install")
- public void testInstallIfArtifactFileIsNull(InstallMojo mojo) throws
Exception {
+ void installIfArtifactFileIsNull(InstallMojo mojo) throws Exception {
assertNotNull(mojo);
Project project = (Project) getVariableValueFromObject(mojo,
"project");
assertFalse(artifactManager.getPath(project.getMainArtifact().get()).isPresent());
@@ -153,7 +153,7 @@ public class InstallMojoTest {
@Test
@InjectMojo(goal = "install")
- public void testSkip(InstallMojo mojo) throws Exception {
+ void skip(InstallMojo mojo) throws Exception {
assertNotNull(mojo);
setVariableValueToObject(mojo, "session", this.session);
mojo.setSkip(true);