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-deploy-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 0b5757c  JUnit Jupiter best practices (#625)
0b5757c is described below

commit 0b5757c350ad98994f7a669f2bdeb17be5e0aca8
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 4 03:04:47 2025 +0100

    JUnit Jupiter best practices (#625)
    
    
    
    Co-authored-by: Moderne <[email protected]>
---
 .../maven/plugins/deploy/DeployFileMojoTest.java   | 10 ++++-----
 .../plugins/deploy/DeployFileMojoUnitTest.java     | 12 +++++-----
 .../plugins/deploy/DeployMojoPomPackagingTest.java |  4 ++--
 .../maven/plugins/deploy/DeployMojoTest.java       | 26 +++++++++++-----------
 4 files changed, 26 insertions(+), 26 deletions(-)

diff --git 
a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java 
b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
index 882d66f..13f6c10 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java
@@ -58,7 +58,7 @@ import static org.mockito.Mockito.when;
  * @author <a href="mailto:[email protected]";>Allan Ramirez</a>
  */
 @MojoTest
-public class DeployFileMojoTest {
+class DeployFileMojoTest {
     private static final String LOCAL_REPO = "target/local-repo";
 
     @Inject
@@ -75,7 +75,7 @@ public class DeployFileMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy-file")
-    public void testDeployTestEnvironment(DeployFileMojo mojo) {
+    void deployTestEnvironment(DeployFileMojo mojo) {
         assertNotNull(mojo);
     }
 
@@ -93,7 +93,7 @@ public class DeployFileMojoTest {
     @MojoParameter(name = "description", value = "POM was created from 
deploy:deploy-file")
     @MojoParameter(name = "generatePom", value = "true")
     @MojoParameter(name = "skip", value = "snapshots")
-    public void testBasicDeployFile(DeployFileMojo mojo) throws Exception {
+    void basicDeployFile(DeployFileMojo mojo) throws Exception {
         assertNotNull(mojo);
 
         String groupId = (String) getVariableValueFromObject(mojo, "groupId");
@@ -155,7 +155,7 @@ public class DeployFileMojoTest {
     @MojoParameter(name = "url", value = 
"file://${session.topDirectory}/target/remote-repo/deploy-file")
     @MojoParameter(name = "classifier", value = "bin")
     @MojoParameter(name = "generatePom", value = "true")
-    public void testDeployIfClassifierIsSet(DeployFileMojo mojo) throws 
Exception {
+    void deployIfClassifierIsSet(DeployFileMojo mojo) throws Exception {
         assertNotNull(mojo);
 
         String groupId = (String) getVariableValueFromObject(mojo, "groupId");
@@ -196,7 +196,7 @@ public class DeployFileMojoTest {
     @MojoParameter(name = "repositoryId", value = "deploy-test")
     @MojoParameter(name = "url", value = 
"file://${session.topDirectory}/target/remote-repo/deploy-file")
     @MojoParameter(name = "generatePom", value = "true")
-    public void testDeployIfArtifactIsNotJar(DeployFileMojo mojo) throws 
Exception {
+    void deployIfArtifactIsNotJar(DeployFileMojo mojo) throws Exception {
         assertNotNull(mojo);
 
         String groupId = (String) getVariableValueFromObject(mojo, "groupId");
diff --git 
a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java 
b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java
index f1d5a29..6a96c4e 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java
@@ -32,12 +32,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 /**
  * @author <a href="[email protected]">Jerome Lacoste</a>
  */
-public class DeployFileMojoUnitTest {
+class DeployFileMojoUnitTest {
     MockDeployFileMojo mojo;
     Parent parent;
 
     @BeforeEach
-    public void setUp() {
+    void setUp() {
         parent = Parent.newBuilder()
                 .groupId("parentGroup")
                 .artifactId("parentArtifact")
@@ -61,7 +61,7 @@ public class DeployFileMojoUnitTest {
     }
 
     @Test
-    public void testProcessPomFromPomFileWithParent4() {
+    void processPomFromPomFileWithParent4() {
         mojo.setPomFile(Paths.get("foo.bar"));
         setMojoModel(mojo, null, "artifact", "version", "packaging", parent);
         mojo.initProperties();
@@ -69,7 +69,7 @@ public class DeployFileMojoUnitTest {
     }
 
     @Test
-    public void testProcessPomFromPomFileWithParent5() {
+    void processPomFromPomFileWithParent5() {
         mojo.setPomFile(Paths.get("foo.bar"));
         setMojoModel(mojo, "group", "artifact", "version", "packaging", 
parent);
         mojo.initProperties();
@@ -77,7 +77,7 @@ public class DeployFileMojoUnitTest {
     }
 
     @Test
-    public void testProcessPomFromPomFileWithParent6() {
+    void processPomFromPomFileWithParent6() {
         mojo.setPomFile(Paths.get("foo.bar"));
         setMojoModel(mojo, "group", "artifact", "version", "packaging", null);
         mojo.initProperties();
@@ -85,7 +85,7 @@ public class DeployFileMojoUnitTest {
     }
 
     @Test
-    public void testProcessPomFromPomFileWithOverrides() {
+    void processPomFromPomFileWithOverrides() {
         mojo.setPomFile(Paths.get("foo.bar"));
         setMojoModel(mojo, "group", "artifact", "version", "packaging", null);
         mojo.setGroupId("groupO");
diff --git 
a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoPomPackagingTest.java 
b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoPomPackagingTest.java
index c82e994..284894b 100644
--- 
a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoPomPackagingTest.java
+++ 
b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoPomPackagingTest.java
@@ -59,7 +59,7 @@ import static org.mockito.Mockito.when;
 
 @MojoTest
 @ExtendWith(MockitoExtension.class)
-public class DeployMojoPomPackagingTest {
+class DeployMojoPomPackagingTest {
 
     private static final String LOCAL_REPO = "/target/local-repo";
 
@@ -82,7 +82,7 @@ public class DeployMojoPomPackagingTest {
     @Test
     @InjectMojo(goal = "deploy")
     @MojoParameter(name = "deployAtEnd", value = "false")
-    public void testBasicDeployWithPackagingAsPom(DeployMojo mojo) throws 
Exception {
+    void basicDeployWithPackagingAsPom(DeployMojo mojo) throws Exception {
         assertNotNull(mojo);
 
         ArtifactDeployerRequest request = execute(mojo);
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java 
b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 4f6809f..c3afbd5 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -70,7 +70,7 @@ import static org.mockito.Mockito.when;
  */
 @MojoTest
 @ExtendWith(MockitoExtension.class)
-public class DeployMojoTest {
+class DeployMojoTest {
 
     private static final String LOCAL_REPO = "target/local-repo";
 
@@ -92,14 +92,14 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testDeployTestEnvironment(DeployMojo mojo) {
+    void deployTestEnvironment(DeployMojo mojo) {
         assertNotNull(mojo);
     }
 
     @Test
     @InjectMojo(goal = "deploy")
     @MojoParameter(name = "deployAtEnd", value = "false")
-    public void testBasicDeploy(DeployMojo mojo) throws Exception {
+    void basicDeploy(DeployMojo mojo) throws Exception {
         assertNotNull(mojo);
         Project project = (Project) getVariableValueFromObject(mojo, 
"project");
         artifactManager.setPath(
@@ -123,7 +123,7 @@ public class DeployMojoTest {
     @Test
     @InjectMojo(goal = "deploy")
     @MojoParameter(name = "deployAtEnd", value = "false")
-    public void testSkippingDeploy(DeployMojo mojo) throws Exception {
+    void skippingDeploy(DeployMojo mojo) throws Exception {
         assertNotNull(mojo);
 
         File file = new File(getBasedir(), 
"target/test-classes/unit/maven-deploy-test-1.0-SNAPSHOT.jar");
@@ -142,7 +142,7 @@ public class DeployMojoTest {
     @Test
     @InjectMojo(goal = "deploy")
     @MojoParameter(name = "deployAtEnd", value = "false")
-    public void testDeployIfArtifactFileIsNull(DeployMojo mojo) throws 
Exception {
+    void deployIfArtifactFileIsNull(DeployMojo mojo) throws Exception {
         assertNotNull(mojo);
 
         Project project = (Project) getVariableValueFromObject(mojo, 
"project");
@@ -154,7 +154,7 @@ public class DeployMojoTest {
     @Test
     @InjectMojo(goal = "deploy")
     @MojoParameter(name = "deployAtEnd", value = "false")
-    public void testDeployWithAttachedArtifacts(DeployMojo mojo) throws 
Exception {
+    void deployWithAttachedArtifacts(DeployMojo mojo) throws Exception {
         assertNotNull(mojo);
         Project project = (Project) getVariableValueFromObject(mojo, 
"project");
         projectManager.attachArtifact(
@@ -182,7 +182,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testLegacyAltDeploymentRepositoryWithDefaultLayout(DeployMojo 
mojo) throws IllegalAccessException {
+    void legacyAltDeploymentRepositoryWithDefaultLayout(DeployMojo mojo) 
throws Exception {
         setVariableValueToObject(mojo, "altDeploymentRepository", 
"altDeploymentRepository::default::http://localhost";);
 
         RemoteRepository repository = mojo.getDeploymentRepository(true);
@@ -192,7 +192,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testLegacyAltDeploymentRepositoryWithLegacyLayout(DeployMojo 
mojo) throws IllegalAccessException {
+    void legacyAltDeploymentRepositoryWithLegacyLayout(DeployMojo mojo) throws 
Exception {
         setVariableValueToObject(mojo, "altDeploymentRepository", 
"altDeploymentRepository::legacy::http://localhost";);
 
         MojoException e = assertThrows(
@@ -207,7 +207,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testInsaneAltDeploymentRepository(DeployMojo mojo) throws 
IllegalAccessException {
+    void insaneAltDeploymentRepository(DeployMojo mojo) throws Exception {
         setVariableValueToObject(
                 mojo, "altDeploymentRepository", 
"altDeploymentRepository::hey::wow::foo::http://localhost";);
 
@@ -223,7 +223,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testDefaultScmSvnAltDeploymentRepository(DeployMojo mojo) 
throws IllegalAccessException {
+    void defaultScmSvnAltDeploymentRepository(DeployMojo mojo) throws 
Exception {
         setVariableValueToObject(
                 mojo, "altDeploymentRepository", 
"altDeploymentRepository::default::scm:svn:http://localhost";);
 
@@ -234,7 +234,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testLegacyScmSvnAltDeploymentRepository(DeployMojo mojo) 
throws IllegalAccessException {
+    void legacyScmSvnAltDeploymentRepository(DeployMojo mojo) throws Exception 
{
         setVariableValueToObject(
                 mojo, "altDeploymentRepository", 
"altDeploymentRepository::legacy::scm:svn:http://localhost";);
 
@@ -250,7 +250,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testAltSnapshotDeploymentRepository(DeployMojo mojo) throws 
IllegalAccessException {
+    void altSnapshotDeploymentRepository(DeployMojo mojo) throws Exception {
         setVariableValueToObject(mojo, "altDeploymentRepository", 
"altReleaseDeploymentRepository::http://localhost";);
 
         RemoteRepository repository = mojo.getDeploymentRepository(true);
@@ -260,7 +260,7 @@ public class DeployMojoTest {
 
     @Test
     @InjectMojo(goal = "deploy")
-    public void testAltReleaseDeploymentRepository(DeployMojo mojo) throws 
IllegalAccessException {
+    void altReleaseDeploymentRepository(DeployMojo mojo) throws Exception {
         setVariableValueToObject(mojo, "altDeploymentRepository", 
"altReleaseDeploymentRepository::http://localhost";);
 
         RemoteRepository repository = mojo.getDeploymentRepository(false);

Reply via email to