From d0ce23e95b6822adfbcbacc17d752b5dd3f84ba2 Mon Sep 17 00:00:00 2001 From: Maor Friedman Date: Sun, 13 Feb 2022 16:18:58 +0200 Subject: [PATCH] fix tests --- .../plugins/ghprb/GhprbRepositoryTest.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/jenkinsci/plugins/ghprb/GhprbRepositoryTest.java b/src/test/java/org/jenkinsci/plugins/ghprb/GhprbRepositoryTest.java index 32653c7c3..92496709e 100644 --- a/src/test/java/org/jenkinsci/plugins/ghprb/GhprbRepositoryTest.java +++ b/src/test/java/org/jenkinsci/plugins/ghprb/GhprbRepositoryTest.java @@ -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(); @@ -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); } @@ -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(); @@ -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); } @@ -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(); @@ -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); } @@ -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(); @@ -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); } @@ -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(); @@ -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);