File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/test/java/com/spotify/github/v3/clients Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3434import static java .util .concurrent .CompletableFuture .completedFuture ;
3535import static org .hamcrest .MatcherAssert .assertThat ;
3636import static org .hamcrest .core .Is .is ;
37+ import static org .junit .Assert .assertFalse ;
3738import static org .junit .Assert .assertTrue ;
3839import static org .mockito .ArgumentMatchers .any ;
3940import static org .mockito .Mockito .mock ;
@@ -145,6 +146,15 @@ public void isCollaborator() throws Exception {
145146 assertTrue (isCollaborator );
146147 }
147148
149+ @ Test
150+ public void isNotCollaborator () throws Exception {
151+ final Response response = mock (Response .class );
152+ when (response .code ()).thenReturn (404 );
153+ when (github .request ("/repos/someowner/somerepo/collaborators/user" )).thenReturn (completedFuture (response ));
154+ boolean isCollaborator = repoClient .isCollaborator ("user" ).get ();
155+ assertFalse (isCollaborator );
156+ }
157+
148158 @ Test
149159 public void listCommits () throws Exception {
150160 final CompletableFuture <List <CommitItem >> fixture =
You can’t perform that action at this time.
0 commit comments