4343import com .google .common .io .Resources ;
4444import com .spotify .github .async .Async ;
4545import com .spotify .github .async .AsyncPage ;
46+ import com .spotify .github .http .HttpResponse ;
4647import com .spotify .github .jackson .Json ;
4748import com .spotify .github .v3 .ImmutableUser ;
4849import com .spotify .github .v3 .comment .Comment ;
@@ -83,13 +84,13 @@ public void testCommentPaginationSpliterator() throws IOException {
8384 "<https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments?page=2>; rel=\" next\" , <https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments?page=2>; rel=\" last\" " ;
8485 final String firstPageBody =
8586 Resources .toString (getResource (this .getClass (), "comments_page1.json" ), defaultCharset ());
86- final Response firstPageResponse = createMockResponse (firstPageLink , firstPageBody );
87+ final HttpResponse firstPageResponse = createMockResponse (firstPageLink , firstPageBody );
8788
8889 final String lastPageLink =
8990 "<https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments>; rel=\" first\" , <https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments>; rel=\" prev\" " ;
9091 final String lastPageBody =
9192 Resources .toString (getResource (this .getClass (), "comments_page2.json" ), defaultCharset ());
92- final Response lastPageResponse = createMockResponse (lastPageLink , lastPageBody );
93+ final HttpResponse lastPageResponse = createMockResponse (lastPageLink , lastPageBody );
9394
9495 when (github .request (format (COMMENTS_URI_NUMBER_TEMPLATE , "someowner" , "somerepo" , "123" )))
9596 .thenReturn (completedFuture (firstPageResponse ));
@@ -112,13 +113,13 @@ public void testCommentPaginationForeach() throws IOException {
112113 "<https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments?page=2>; rel=\" next\" , <https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments?page=2>; rel=\" last\" " ;
113114 final String firstPageBody =
114115 Resources .toString (getResource (this .getClass (), "comments_page1.json" ), defaultCharset ());
115- final Response firstPageResponse = createMockResponse (firstPageLink , firstPageBody );
116+ final HttpResponse firstPageResponse = createMockResponse (firstPageLink , firstPageBody );
116117
117118 final String lastPageLink =
118119 "<https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments>; rel=\" first\" , <https://github.com/api/v3/repos/someowner/somerepo/issues/123/comments>; rel=\" prev\" " ;
119120 final String lastPageBody =
120121 Resources .toString (getResource (this .getClass (), "comments_page2.json" ), defaultCharset ());
121- final Response lastPageResponse = createMockResponse (lastPageLink , lastPageBody );
122+ final HttpResponse lastPageResponse = createMockResponse (lastPageLink , lastPageBody );
122123
123124 when (github .request (format (COMMENTS_URI_NUMBER_TEMPLATE , "someowner" , "somerepo" , "123" )))
124125 .thenReturn (completedFuture (firstPageResponse ));
@@ -142,7 +143,7 @@ public void testCommentPaginationForeach() throws IOException {
142143 @ Test
143144 public void testCommentCreated () throws IOException {
144145 final String fixture = loadFixture ("clients/comment_created.json" );
145- final Response response = createMockResponse ("" , fixture );
146+ final HttpResponse response = createMockResponse ("" , fixture );
146147 final String path = format (COMMENTS_URI_NUMBER_TEMPLATE , "someowner" , "somerepo" , 10 );
147148 when (github .post (anyString (), anyString (), eq (Comment .class ))).thenCallRealMethod ();
148149 when (github .post (eq (path ), anyString ())).thenReturn (completedFuture (response ));
@@ -154,7 +155,7 @@ public void testCommentCreated() throws IOException {
154155 @ Test
155156 public void testCommentCreatedWithLargeId () throws IOException {
156157 final String fixture = loadFixture ("clients/comment_created_long_id.json" );
157- final Response response = createMockResponse ("" , fixture );
158+ final HttpResponse response = createMockResponse ("" , fixture );
158159 final String path = format (COMMENTS_URI_NUMBER_TEMPLATE , "someowner" , "somerepo" , 10 );
159160 when (github .post (anyString (), anyString (), eq (Comment .class ))).thenCallRealMethod ();
160161 when (github .post (eq (path ), anyString ())).thenReturn (completedFuture (response ));
@@ -210,8 +211,8 @@ public void testDeleteIssueCommentReaction() {
210211 long reactionId = 385825 ;
211212 final String path =
212213 format (COMMENTS_REACTION_ID_TEMPLATE , "someowner" , "somerepo" , issueNumber , reactionId );
213- Response mockResponse = mock (Response .class );
214- when (mockResponse .code ()).thenReturn (204 );
214+ HttpResponse mockResponse = mock (HttpResponse .class );
215+ when (mockResponse .statusCode ()).thenReturn (204 );
215216 when (github .delete (eq (path ))).thenReturn (completedFuture (mockResponse ));
216217
217218 final var response = issueClient .deleteCommentReaction (issueNumber , reactionId ).join ();
@@ -239,7 +240,7 @@ public void testListIssueCommentReaction() throws IOException {
239240 "<https://github.com/api/v3/repos/someowner/somerepo/comments/%s/reactions?page=1>; rel=\" last\" " ,
240241 commentId );
241242 final String firstPageBody = github .json ().toJsonUnchecked (listResponse .join ().toArray ());
242- final Response firstPageResponse = createMockResponse (firstPageLink , firstPageBody );
243+ final HttpResponse firstPageResponse = createMockResponse (firstPageLink , firstPageBody );
243244
244245 when (github .request (eq (path ))).thenReturn (completedFuture (firstPageResponse ));
245246 final List <CommentReaction > listCommentReactions = Lists .newArrayList ();
0 commit comments