Skip to content

Commit 7a63bcb

Browse files
authored
Mock GHRepository instead of creating new instance
1 parent ad3d7b3 commit 7a63bcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/process/GitHubPullRequestSenderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void testForkRepositoriesFound() throws Exception {
4343
when(contentsWithImageIterator.next()).thenReturn(content1, content2, content3, null);
4444
when(contentsWithImage.iterator()).thenReturn(contentsWithImageIterator);
4545

46-
when(dockerfileGitHubUtil.getOrCreateFork(Mockito.any())).thenReturn(new GHRepository());
46+
when(dockerfileGitHubUtil.getOrCreateFork(Mockito.any())).thenReturn(mock(GHRepository.class));
4747
when(dockerfileGitHubUtil.getRepo(any())).thenReturn(mock(GHRepository.class));
4848

4949
ForkableRepoValidator forkableRepoValidator = mock(ForkableRepoValidator.class);
@@ -86,7 +86,7 @@ public void testForkRepositoriesFoundWithExcludes() throws Exception {
8686
when(contentsWithImageIterator.next()).thenReturn(content1, content2, content3, null);
8787
when(contentsWithImage.iterator()).thenReturn(contentsWithImageIterator);
8888

89-
when(dockerfileGitHubUtil.getOrCreateFork(Mockito.any())).thenReturn(new GHRepository());
89+
when(dockerfileGitHubUtil.getOrCreateFork(Mockito.any())).thenReturn(mock(GHRepository.class));
9090
when(dockerfileGitHubUtil.getRepo(any())).thenReturn(mock(GHRepository.class));
9191

9292
ForkableRepoValidator forkableRepoValidator = mock(ForkableRepoValidator.class);

0 commit comments

Comments
 (0)