Skip to content

Commit 877f841

Browse files
committed
Test cases are all adjusted, and they found some thing.
1 parent 5aedf12 commit 877f841

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

src/main/java/com/e_gineering/maven/gitflowhelper/OtherBranchVersionExtension.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.apache.maven.model.Parent;
1212
import org.apache.maven.model.Plugin;
1313
import org.apache.maven.model.ReportPlugin;
14-
import org.apache.maven.model.io.ModelReader;
1514
import org.apache.maven.model.io.ModelWriter;
1615
import org.apache.maven.project.MavenProject;
1716
import org.codehaus.plexus.component.annotations.Component;
@@ -25,9 +24,6 @@
2524
@Component(role = AbstractMavenLifecycleParticipant.class, hint = "other-branch-version")
2625
public class OtherBranchVersionExtension extends AbstractBranchDetectingExtension {
2726

28-
@Requirement(role = ModelReader.class)
29-
ModelReader modelReader;
30-
3127
@Requirement(role = ModelWriter.class)
3228
ModelWriter modelWriter;
3329

src/main/java/com/e_gineering/maven/gitflowhelper/RetargetDeployMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ protected void execute(final GitBranchInfo gitBranchInfo) throws MojoExecutionEx
3737
String otherBranchesToDeploy = resolveExpression(otherDeployBranchPattern);
3838
if (!"".equals(otherBranchesToDeploy) && gitBranchInfo.getName().matches(otherBranchesToDeploy)) {
3939
setTargetSnapshots();
40+
// Only break if we set something!
41+
break;
4042
}
41-
break;
4243
}
4344
default: {
4445
unsetRepos();

src/test/java/com/e_gineering/maven/gitflowhelper/OtherBranchIT.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void featureSnapshotSemVer() throws Exception {
1616
verifier.addCliOption("-Dexpression=project.version");
1717
verifier.executeGoal("help:evaluate");
1818

19-
verifier.verifyTextInLog("Artifact versions updated with build metadata: +origin-feature-poc-my-feature-branch-SNAPSHOT");
19+
verifier.verifyTextInLog("Updating project com.e-gineering:gitflow-helper-maven-plugin-test-stub:5.0.0-SNAPSHOT to: 5.0.0+origin-feature-poc-my-feature-branch-SNAPSHOT");
2020
verifier.verifyErrorFreeLog();
2121
} finally {
2222
verifier.resetStreams();
@@ -28,8 +28,8 @@ public void featureSemVer() throws Exception {
2828
Verifier verifier = createVerifier("/project-stub", "origin/feature/poc/my-feature-branch.with.other.identifiers", "5.0.1");
2929
try {
3030
verifier.executeGoal("initialize");
31-
32-
verifier.verifyTextInLog("Artifact versions updated with build metadata: +origin-feature-poc-my-feature-branch.with.other.identifiers-SNAPSHOT");
31+
32+
verifier.verifyTextInLog("Updating project com.e-gineering:gitflow-helper-maven-plugin-test-stub:5.0.1 to: 5.0.1+origin-feature-poc-my-feature-branch.with.other.identifiers-SNAPSHOT");
3333
verifier.verifyErrorFreeLog();
3434
} finally {
3535
verifier.resetStreams();
@@ -55,8 +55,8 @@ public void automagicVersionDependenciesResolve() throws Exception {
5555
Verifier verifier = createVerifier("/project-stub", "origin/feature/poc/long-running", "2.0.0");
5656
try {
5757
verifier.executeGoal("deploy");
58-
59-
verifier.verifyTextInLog("Artifact versions updated with build metadata: +origin-feature-poc-long-running-SNAPSHOT");
58+
59+
verifier.verifyTextInLog("Updating project com.e-gineering:gitflow-helper-maven-plugin-test-stub:2.0.0 to: 2.0.0+origin-feature-poc-long-running-SNAPSHOT");
6060
verifier.verifyErrorFreeLog();
6161
} finally {
6262
verifier.resetStreams();
@@ -70,7 +70,8 @@ public void automagicVersionDependenciesResolve() throws Exception {
7070
verifier.getCliOptions().add("-Dplugin.stub.version=2.0.0+origin-feature-poc-long-running-SNAPSHOT");
7171

7272
verifier.executeGoal("deploy");
73-
verifier.verifyTextInLog("Artifact versions updated with build metadata: -origin-feature-poc-long-running-SNAPSHOT");
73+
// the alt project uses the `-` as the version delimiter, rather than `+`
74+
verifier.verifyTextInLog("Updating project com.e-gineering:gitflow-helper-maven-plugin-test-stub-alt:2.0.0 to: 2.0.0-origin-feature-poc-long-running-SNAPSHOT");
7475
verifier.verifyErrorFreeLog();
7576
} finally {
7677
verifier.resetStreams();
@@ -82,8 +83,7 @@ public void attachDeployed() throws Exception {
8283
Verifier verifier = createVerifier("/project-stub", "origin/feature/poc/reattach", "5.0.0-SNAPSHOT");
8384
try {
8485
verifier.executeGoal("deploy");
85-
86-
verifier.verifyTextInLog("Artifact versions updated with build metadata: +origin-feature-poc-reattach-SNAPSHOT");
86+
verifier.verifyTextInLog("Updating project com.e-gineering:gitflow-helper-maven-plugin-test-stub:5.0.0-SNAPSHOT to: 5.0.0+origin-feature-poc-reattach-SNAPSHOT");
8787
verifier.verifyErrorFreeLog();
8888
} finally {
8989
verifier.resetStreams();
@@ -92,6 +92,7 @@ public void attachDeployed() throws Exception {
9292
verifier = createVerifier("/project-stub", "origin/feature/poc/reattach", "5.0.0-SNAPSHOT");
9393
try {
9494
verifier.executeGoals(Arrays.asList("validate", "gitflow-helper:attach-deployed"));
95+
verifier.verifyTextInLog("Updating project com.e-gineering:gitflow-helper-maven-plugin-test-stub:5.0.0-SNAPSHOT to: 5.0.0+origin-feature-poc-reattach-SNAPSHOT");
9596
verifier.verifyErrorFreeLog();
9697
} finally {
9798
verifier.resetStreams();

src/test/java/com/e_gineering/maven/gitflowhelper/RetargetDeployIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ public void masterTargetsReleases() throws Exception {
123123

124124
@Test
125125
public void othersUnsetRepos() throws Exception {
126-
// Deploy a hotfix to the test-releases.
127126
Verifier verifier = createVerifier("/project-stub", "feature/undeployable", "3.5.0-SNAPSHOT");
128127
try {
129128
verifier.executeGoal("deploy");

0 commit comments

Comments
 (0)