Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/java/com/spotify/github/v3/prs/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -94,4 +94,8 @@ public interface Comment extends UpdateTracking {
@Nullable
@JsonProperty("_links")
CommentLinks links();

/** Node ID */
@Nullable
String nodeId();
}
12 changes: 9 additions & 3 deletions src/main/java/com/spotify/github/v3/prs/PullRequestItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -122,6 +122,12 @@ public interface PullRequestItem extends PartialPullRequestItem {
@JsonProperty("requested_teams")
List<User> requestedTeams();

/** @Deprecated the merge commit sha. */
/**
* @Deprecated the merge commit sha.
*/
Optional<String> mergeCommitSha();

/** Node ID. */
@Nullable
String nodeId();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*-
* -\-\-
* github-client
* --
* Copyright (C) 2016 - 2020 Spotify AB
* --
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* -/-/-
*/

package com.spotify.github.v3.activity.events;

import java.io.IOException;
import static java.nio.charset.Charset.defaultCharset;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import org.junit.jupiter.api.Test;

import com.google.common.io.Resources;
import static com.google.common.io.Resources.getResource;
import com.spotify.github.jackson.Json;

public class PullRequestReviewCommentEventTest {
@Test
public void testDeserialization() throws IOException {
String fixture =
Resources.toString(
getResource(this.getClass(), "fixtures/pull_request_review_comment_event.json"),
defaultCharset());
final PullRequestReviewCommentEvent event =
Json.create().fromJson(fixture, PullRequestReviewCommentEvent.class);
assertThat(event.action(), is("created"));
assertThat(event.comment().id(), is(29724692L));
assertThat(event.comment().nodeId(), is("abc234"));
assertThat(event.pullRequest().nodeId(), is("abc123"));
assertThat(event.comment().body(), is("Maybe you should use more emojji on this line."));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"comment": {
"url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692",
"id": 29724692,
"node_id": "abc234",
"diff_hunk": "@@ -1 +1 @@\n-# public-repo",
"path": "README.md",
"position": 1,
Expand Down Expand Up @@ -48,6 +49,7 @@
"pull_request": {
"url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1",
"id": 34778301,
"node_id": "abc123",
"html_url": "https://github.com/baxterthehacker/public-repo/pull/1",
"diff_url": "https://github.com/baxterthehacker/public-repo/pull/1.diff",
"patch_url": "https://github.com/baxterthehacker/public-repo/pull/1.patch",
Expand Down