Skip to content

Commit d8d94ce

Browse files
committed
Redid this test.
1 parent c5c9a72 commit d8d94ce

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

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

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ public class ReleaseBranchIT extends AbstractIntegrationTest {
1414
/**
1515
* Non-snapshot versions on the develop branch should fail.
1616
*/
17-
@Test(expected = VerificationException.class)
17+
@Test
1818
public void snapshotDeployFails() throws Exception {
1919
Verifier verifier = createVerifier("/project-stub", "origin/release/1.0.0", "1.0.0-SNAPSHOT");
2020

2121
try {
2222
verifier.executeGoal("deploy");
2323
} catch (Exception ex) {
2424
verifier.verifyTextInLog("The current git branch: [origin/release/1.0.0] is defined as a release branch. The maven project or one of its parents is currently a snapshot version.");
25-
throw ex;
2625
} finally {
2726
verifier.resetStreams();
2827
}
@@ -36,13 +35,11 @@ public void snapshotDeployFails() throws Exception {
3635
public void deploySuccess() throws Exception {
3736
Verifier verifier = createVerifier("/project-stub", "origin/release/1.0.0", "1.0.0");
3837

39-
try {
40-
verifier.executeGoal("deploy");
38+
verifier.executeGoal("deploy");
4139

42-
verifier.verifyErrorFreeLog();
43-
} finally {
44-
verifier.resetStreams();
45-
}
40+
verifier.verifyErrorFreeLog();
41+
42+
verifier.resetStreams();
4643
}
4744

4845
/**
@@ -54,25 +51,19 @@ public void deploySuccess() throws Exception {
5451
public void attachExistingArtifacts() throws Exception {
5552
Verifier verifier = createVerifier("/project-stub", "origin/release/1.0.0", "1.0.0");
5653

57-
try {
58-
verifier.executeGoal("deploy");
54+
verifier.executeGoal("deploy");
5955

60-
verifier.verifyErrorFreeLog();
61-
} finally {
62-
verifier.resetStreams();
63-
}
56+
verifier.verifyErrorFreeLog();
57+
58+
verifier.resetStreams();
6459

6560
// Now re-attach in another verifier.
6661
verifier = createVerifier("/project-stub", "origin/release/1.0.0", "1.0.0");
6762

68-
try {
69-
// Allow -SNAPSHOT builds of the plugin to succeed while still asserting the version match.
70-
verifier.getCliOptions().add("-DenforceNonSnapshots=false");
71-
verifier.executeGoal("gitflow-helper:attach-deployed");
63+
// Allow -SNAPSHOT builds of the plugin to succeed while still asserting the version match.
64+
verifier.getCliOptions().add("-DenforceNonSnapshots=false");
65+
verifier.executeGoal("gitflow-helper:attach-deployed");
7266

73-
verifier.verifyErrorFreeLog();
74-
} finally {
75-
verifier.resetStreams();
76-
}
67+
verifier.verifyErrorFreeLog();
7768
}
7869
}

0 commit comments

Comments
 (0)