Skip to content

Commit f43625e

Browse files
committed
add nodeId to prs.comment as well
1 parent 8c17971 commit f43625e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/main/java/com/spotify/github/v3/prs/Comment.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,4 +94,8 @@ public interface Comment extends UpdateTracking {
9494
@Nullable
9595
@JsonProperty("_links")
9696
CommentLinks links();
97+
98+
/** Node ID */
99+
@Nullable
100+
String nodeId();
97101
}

src/test/java/com/spotify/github/v3/activity/events/PullRequestReviewCommentEventTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020

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

23-
import static com.google.common.io.Resources.getResource;
23+
import java.io.IOException;
2424
import static java.nio.charset.Charset.defaultCharset;
25+
2526
import static org.hamcrest.MatcherAssert.assertThat;
2627
import static org.hamcrest.core.Is.is;
28+
import org.junit.jupiter.api.Test;
2729

2830
import com.google.common.io.Resources;
31+
import static com.google.common.io.Resources.getResource;
2932
import com.spotify.github.jackson.Json;
30-
import java.io.IOException;
31-
import org.junit.jupiter.api.Test;
3233

3334
public class PullRequestReviewCommentEventTest {
3435
@Test
@@ -41,6 +42,7 @@ public void testDeserialization() throws IOException {
4142
Json.create().fromJson(fixture, PullRequestReviewCommentEvent.class);
4243
assertThat(event.action(), is("created"));
4344
assertThat(event.comment().id(), is(29724692L));
45+
assertThat(event.comment().nodeId(), is("abc234"));
4446
assertThat(event.pullRequest().nodeId(), is("abc123"));
4547
assertThat(event.comment().body(), is("Maybe you should use more emojji on this line."));
4648
}

src/test/resources/com/spotify/github/v3/activity/events/fixtures/pull_request_review_comment_event.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"comment": {
44
"url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/29724692",
55
"id": 29724692,
6+
"node_id": "abc234",
67
"diff_hunk": "@@ -1 +1 @@\n-# public-repo",
78
"path": "README.md",
89
"position": 1,

0 commit comments

Comments
 (0)