Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* @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
Expand All @@ -75,7 +75,7 @@ public class DeployFileMojoTest {

@Test
@InjectMojo(goal = "deploy-file")
public void testDeployTestEnvironment(DeployFileMojo mojo) {
void deployTestEnvironment(DeployFileMojo mojo) {
assertNotNull(mojo);
}

Expand All @@ -93,7 +93,7 @@ public void testDeployTestEnvironment(DeployFileMojo mojo) {
@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");
Expand Down Expand Up @@ -155,7 +155,7 @@ public void testBasicDeployFile(DeployFileMojo mojo) throws Exception {
@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");
Expand Down Expand Up @@ -196,7 +196,7 @@ public void testDeployIfClassifierIsSet(DeployFileMojo mojo) throws Exception {
@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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
/**
* @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")
Expand All @@ -61,31 +61,31 @@ protected Model readModel(Path pomFile) throws MojoException {
}

@Test
public void testProcessPomFromPomFileWithParent4() {
void processPomFromPomFileWithParent4() {
mojo.setPomFile(Paths.get("foo.bar"));
setMojoModel(mojo, null, "artifact", "version", "packaging", parent);
mojo.initProperties();
checkMojoProperties("parentGroup", "artifact", "version", "packaging");
}

@Test
public void testProcessPomFromPomFileWithParent5() {
void processPomFromPomFileWithParent5() {
mojo.setPomFile(Paths.get("foo.bar"));
setMojoModel(mojo, "group", "artifact", "version", "packaging", parent);
mojo.initProperties();
checkMojoProperties("group", "artifact", "version", "packaging");
}

@Test
public void testProcessPomFromPomFileWithParent6() {
void processPomFromPomFileWithParent6() {
mojo.setPomFile(Paths.get("foo.bar"));
setMojoModel(mojo, "group", "artifact", "version", "packaging", null);
mojo.initProperties();
checkMojoProperties("group", "artifact", "version", "packaging");
}

@Test
public void testProcessPomFromPomFileWithOverrides() {
void processPomFromPomFileWithOverrides() {
mojo.setPomFile(Paths.get("foo.bar"));
setMojoModel(mojo, "group", "artifact", "version", "packaging", null);
mojo.setGroupId("groupO");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

@MojoTest
@ExtendWith(MockitoExtension.class)
public class DeployMojoPomPackagingTest {
class DeployMojoPomPackagingTest {

private static final String LOCAL_REPO = "/target/local-repo";

Expand All @@ -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);
Expand Down
26 changes: 13 additions & 13 deletions src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
*/
@MojoTest
@ExtendWith(MockitoExtension.class)
public class DeployMojoTest {
class DeployMojoTest {

private static final String LOCAL_REPO = "target/local-repo";

Expand All @@ -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(
Expand All @@ -123,7 +123,7 @@ public void testBasicDeploy(DeployMojo mojo) throws Exception {
@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");
Expand All @@ -142,7 +142,7 @@ public void testSkippingDeploy(DeployMojo mojo) throws Exception {
@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");
Expand All @@ -154,7 +154,7 @@ public void testDeployIfArtifactFileIsNull(DeployMojo mojo) throws Exception {
@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(
Expand Down Expand Up @@ -182,7 +182,7 @@ public void testDeployWithAttachedArtifacts(DeployMojo mojo) throws Exception {

@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);
Expand All @@ -192,7 +192,7 @@ public void testLegacyAltDeploymentRepositoryWithDefaultLayout(DeployMojo mojo)

@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(
Expand All @@ -207,7 +207,7 @@ public void testLegacyAltDeploymentRepositoryWithLegacyLayout(DeployMojo mojo) t

@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");

Expand All @@ -223,7 +223,7 @@ public void testInsaneAltDeploymentRepository(DeployMojo mojo) throws IllegalAcc

@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");

Expand All @@ -234,7 +234,7 @@ public void testDefaultScmSvnAltDeploymentRepository(DeployMojo mojo) throws Ill

@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");

Expand All @@ -250,7 +250,7 @@ public void testLegacyScmSvnAltDeploymentRepository(DeployMojo mojo) throws Ille

@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);
Expand All @@ -260,7 +260,7 @@ public void testAltSnapshotDeploymentRepository(DeployMojo mojo) throws IllegalA

@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);
Expand Down