Skip to content

Commit d16a752

Browse files
committed
Fix mocking Previews
1 parent 4bec27f commit d16a752

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/main/java/org/kohsuke/github/Previews.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author Kohsuke Kawaguchi
99
*/
10-
enum Previews {
10+
public enum Previews {
1111

1212
/**
1313
* Check-runs and check-suites
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.kohsuke.github;
2+
3+
import org.junit.Test;
4+
5+
import java.io.IOException;
6+
7+
import static org.junit.Assert.assertTrue;
8+
import static org.mockito.Mockito.mock;
9+
import static org.mockito.Mockito.when;
10+
11+
public class GHPullRequestMockTest {
12+
13+
@Test
14+
public void shouldMockGHPullRequest() throws IOException {
15+
GHPullRequest pullRequest = mock(GHPullRequest.class);
16+
when(pullRequest.isDraft()).thenReturn(true);
17+
18+
assertTrue("Mock should return true", pullRequest.isDraft());
19+
}
20+
21+
}

0 commit comments

Comments
 (0)