aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorNicholas Blair <nicholas.blair@gmail.com>2017-02-18 16:13:33 -0600
committerNicholas Blair <nicholas.blair@gmail.com>2017-02-18 16:13:33 -0600
commit83260d55784677708a6ab083b06c289ad528099f (patch)
tree8734e6d3a49fc9e8dc96e53b9000d2858d89ba85 /src/test/java
parent96e6cb666be9cce3f923e3eed39e5e08293c31c5 (diff)
downloadbbprb-83260d55784677708a6ab083b06c289ad528099f.tar.gz
fix: can't have 2 @DataBoundConstructors
Refactor to move default value for commentTrigger to config.jelly. Handle special case in BitbucketBuildRepository where trigger field is null within unit tests (since BitbucketBuildTrigger can't be mocked or initialized in the test).
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/BitbucketBuildFilterTest.java6
-rw-r--r--src/test/java/BitbucketBuildRepositoryTest.java9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/test/java/BitbucketBuildFilterTest.java b/src/test/java/BitbucketBuildFilterTest.java
index 3a94c82..2bc03fa 100644
--- a/src/test/java/BitbucketBuildFilterTest.java
+++ b/src/test/java/BitbucketBuildFilterTest.java
@@ -1,5 +1,7 @@
+import antlr.ANTLRException;
import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildFilter;
+import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger;
import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketCause;
import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketPullRequestsBuilder;
import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketRepository;
@@ -194,8 +196,8 @@ public class BitbucketBuildFilterTest {
@Test
@WithoutJenkins
- public void filterPRComments() {
- BitbucketPullRequestsBuilder builder = EasyMock.createMock(BitbucketPullRequestsBuilder.class);
+ public void filterPRComments() throws ANTLRException {
+ BitbucketPullRequestsBuilder builder = EasyMock.createMock(BitbucketPullRequestsBuilder.class);
EasyMock.expect(builder.getTrigger()).andReturn(null).anyTimes();
EasyMock.replay(builder);
diff --git a/src/test/java/BitbucketBuildRepositoryTest.java b/src/test/java/BitbucketBuildRepositoryTest.java
index 953bd81..7a338a7 100644
--- a/src/test/java/BitbucketBuildRepositoryTest.java
+++ b/src/test/java/BitbucketBuildRepositoryTest.java
@@ -118,7 +118,8 @@ public class BitbucketBuildRepositoryTest {
"", true,
"", "", "",
true,
- true
+ true,
+ BitbucketRepository.DEFAULT_COMMENT_TRIGGER
);
BitbucketPullRequestsBuilder builder = EasyMock.createMock(BitbucketPullRequestsBuilder.class);
@@ -148,7 +149,7 @@ public class BitbucketBuildRepositoryTest {
"", true,
"", "", "",
true,
- true
+ true, BitbucketRepository.DEFAULT_COMMENT_TRIGGER
);
BitbucketPullRequestsBuilder builder = EasyMock.createMock(BitbucketPullRequestsBuilder.class);
@@ -202,7 +203,7 @@ public class BitbucketBuildRepositoryTest {
"", true,
"jenkins", "Jenkins", "",
true,
- true
+ true, BitbucketRepository.DEFAULT_COMMENT_TRIGGER
);
BitbucketPullRequestsBuilder builder = EasyMock.createMock(BitbucketPullRequestsBuilder.class);
@@ -248,7 +249,7 @@ public class BitbucketBuildRepositoryTest {
"", true,
"jenkins-too-long-ci-key", "Jenkins", "",
true,
- true
+ true, BitbucketRepository.DEFAULT_COMMENT_TRIGGER
);
final MessageDigest MD5 = MessageDigest.getInstance("MD5");