@@ -52,8 +52,8 @@ public void checkPullRequestMade(Map<String, Object> inputMap) throws Exception
5252 DockerfileGitHubUtil dockerfileGitHubUtil = mock (DockerfileGitHubUtil .class );
5353 RateLimiter rateLimiter = new RateLimiter ();
5454 GitHubJsonStore imageTagStore = mock (GitHubJsonStore .class );
55- when (dockerfileGitHubUtil .getRepo (any ())).thenReturn (new GHRepository ( ));
56- when (dockerfileGitHubUtil .getOrCreateFork (any ())).thenReturn (new GHRepository ( ));
55+ when (dockerfileGitHubUtil .getRepo (any ())).thenReturn (mock ( GHRepository . class ));
56+ when (dockerfileGitHubUtil .getOrCreateFork (any ())).thenReturn (mock ( GHRepository . class ));
5757 doNothing ().when (dockerfileGitHubUtil ).modifyAllOnGithub (any (), any (), any (), any (), any ());
5858
5959 when (dockerfileGitHubUtil .getGitHubJsonStore ("test" )).thenReturn (imageTagStore );
@@ -81,8 +81,8 @@ public void checkPullRequestMadeForS3ImageStore() throws Exception {
8181 Namespace ns = new Namespace (nsMap );
8282 DockerfileGitHubUtil dockerfileGitHubUtil = mock (DockerfileGitHubUtil .class );
8383
84- when (dockerfileGitHubUtil .getRepo (any ())).thenReturn (new GHRepository ( ));
85- when (dockerfileGitHubUtil .getOrCreateFork (any ())).thenReturn (new GHRepository ( ));
84+ when (dockerfileGitHubUtil .getRepo (any ())).thenReturn (mock ( GHRepository . class ));
85+ when (dockerfileGitHubUtil .getOrCreateFork (any ())).thenReturn (mock ( GHRepository . class ));
8686 doNothing ().when (dockerfileGitHubUtil ).modifyAllOnGithub (any (), any (), any (), any (), any ());
8787 doNothing ().when (dockerfileGitHubUtil ).createPullReq (any (), anyString (), any (), any (),eq (null ));
8888
0 commit comments