Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maorfr committed Feb 13, 2022
1 parent 25342bd commit d0ce23e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/test/java/org/jenkinsci/plugins/ghprb/GhprbRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void testCheckMethodWithOnlyExistingPRs() throws Exception {
verify(ghPullRequest, times(2)).getHead();
verify(ghPullRequest, times(2)).getNumber();
verify(ghPullRequest, times(1)).getUpdatedAt();
verify(ghPullRequest, times(1)).getUser();
verify(ghPullRequest, times(2)).getUser();
verify(ghPullRequest, times(2)).getBase();
verify(ghPullRequest, times(1)).getComments();
verify(ghPullRequest, times(1)).listCommits();
Expand All @@ -239,6 +239,7 @@ public void testCheckMethodWithOnlyExistingPRs() throws Exception {
verifyNoMoreInteractions(gt);

verify(ghUser, times(1)).getName();
verify(ghUser, times(1)).getLogin();
verifyNoMoreInteractions(ghUser);
verifyZeroInteractions(ghUser);
}
Expand Down Expand Up @@ -290,7 +291,7 @@ public void testCheckMethodWithNewPR() throws Exception {
verifyNoMoreInteractions(ghRepository);

verify(ghPullRequest, times(1)).getTitle();
verify(ghPullRequest, times(3)).getUser();
verify(ghPullRequest, times(5)).getUser();
verify(ghPullRequest, times(1)).getMergeable(); // Call to Github API
verify(ghPullRequest, times(7)).getHead();
verify(ghPullRequest, times(6)).getBase();
Expand Down Expand Up @@ -318,7 +319,7 @@ public void testCheckMethodWithNewPR() throws Exception {
verifyNoMoreInteractions(helper);

verify(ghUser, times(1)).getEmail(); // Call to Github API
verify(ghUser, times(1)).getLogin();
verify(ghUser, times(3)).getLogin();
verifyNoMoreInteractions(ghUser);
}

Expand Down Expand Up @@ -471,7 +472,7 @@ public void testCheckBuildWithBlackWhiteLabelsSet() throws Exception {
verifyNoMoreInteractions(ghRepository);

verify(ghPullRequest, times(1)).getTitle();
verify(ghPullRequest, times(3)).getUser();
verify(ghPullRequest, times(5)).getUser();
verify(ghPullRequest, times(1)).getMergeable(); // Call to Github API
verify(ghPullRequest, times(7)).getHead();
verify(ghPullRequest, times(6)).getBase();
Expand Down Expand Up @@ -499,7 +500,7 @@ public void testCheckBuildWithBlackWhiteLabelsSet() throws Exception {
verifyNoMoreInteractions(helper);

verify(ghUser, times(1)).getEmail(); // Call to Github API
verify(ghUser, times(1)).getLogin();
verify(ghUser, times(3)).getLogin();
verifyNoMoreInteractions(ghUser);
}

Expand Down Expand Up @@ -563,7 +564,7 @@ public void testCheckMethodWhenPrWasUpdatedWithNonKeyPhrase() throws Exception {
verifyNoMoreInteractions(ghRepository);

verify(ghPullRequest, times(1)).getTitle();
verify(ghPullRequest, times(5)).getUser();
verify(ghPullRequest, times(7)).getUser();
verify(ghPullRequest, times(1)).getMergeable(); // Call to Github API
verify(ghPullRequest, times(7)).getHead();
verify(ghPullRequest, times(6)).getBase();
Expand Down Expand Up @@ -599,7 +600,7 @@ public void testCheckMethodWhenPrWasUpdatedWithNonKeyPhrase() throws Exception {
verifyNoMoreInteractions(helper);

verify(ghUser, times(1)).getEmail(); // Call to Github API
verify(ghUser, times(2)).getLogin();
verify(ghUser, times(4)).getLogin();
verify(ghUser, times(3)).getName();
verifyNoMoreInteractions(ghUser);
}
Expand Down Expand Up @@ -665,7 +666,7 @@ public void testCheckMethodWhenPrWasUpdatedWithRetestPhrase() throws Exception {
verifyNoMoreInteractions(ghRepository);

verify(ghPullRequest, times(2)).getTitle();
verify(ghPullRequest, times(5)).getUser();
verify(ghPullRequest, times(7)).getUser();
verify(ghPullRequest, times(2)).getMergeable(); // Call to Github API
verify(ghPullRequest, times(9)).getHead();
verify(ghPullRequest, times(7)).getBase();
Expand Down Expand Up @@ -701,7 +702,7 @@ public void testCheckMethodWhenPrWasUpdatedWithRetestPhrase() throws Exception {
verifyNoMoreInteractions(helper);

verify(ghUser, times(1)).getEmail(); // Call to Github API
verify(ghUser, times(2)).getLogin();
verify(ghUser, times(4)).getLogin();
verify(ghUser, times(2)).getName();
verifyNoMoreInteractions(ghUser);

Expand Down

0 comments on commit d0ce23e

Please sign in to comment.