File tree Expand file tree Collapse file tree 6 files changed +81
-29
lines changed
main/java/com/spotify/github/v3
test/java/com/spotify/github/v3 Expand file tree Collapse file tree 6 files changed +81
-29
lines changed Original file line number Diff line number Diff line change 22
22
23
23
import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
24
24
import com .spotify .github .GithubStyle ;
25
+
26
+ import java .util .List ;
25
27
import java .util .Optional ;
28
+
29
+ import com .spotify .github .v3 .prs .PartialPullRequestItem ;
26
30
import org .immutables .value .Value ;
27
31
28
32
/** The CheckRun response resource. */
@@ -73,4 +77,10 @@ public interface CheckRunResponse extends CheckRunBase {
73
77
* @return the optional
74
78
*/
75
79
Optional <App > app ();
80
+
81
+ /**
82
+ * Pull Requests where this check is applied.
83
+ * @return the list of pull requests
84
+ */
85
+ List <PartialPullRequestItem > pullRequests ();
76
86
}
Original file line number Diff line number Diff line change 7
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
8
* you may not use this file except in compliance with the License.
9
9
* You may obtain a copy of the License at
10
- *
10
+ *
11
11
* http://www.apache.org/licenses/LICENSE-2.0
12
- *
12
+ *
13
13
* Unless required by applicable law or agreed to in writing, software
14
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
22
23
23
import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
24
24
import com .spotify .github .GithubStyle ;
25
+
26
+ import java .util .List ;
25
27
import java .util .Optional ;
28
+
29
+ import com .spotify .github .v3 .prs .PartialPullRequestItem ;
26
30
import org .immutables .value .Value ;
27
31
28
- /** Github CheckSuite */
32
+ /** GitHub CheckSuite */
29
33
@ Value .Immutable
30
34
@ GithubStyle
31
35
@ JsonDeserialize (as = ImmutableCheckSuite .class )
32
36
public interface CheckSuite {
33
37
34
38
/**
35
- * The Check Suite Id .
39
+ * The Check Suite id .
36
40
*
37
- * @return the integer
41
+ * @return the long id
38
42
*/
39
43
Long id ();
40
44
41
45
Optional <App > app ();
42
46
43
47
Optional <String > headBranch ();
48
+
49
+ /**
50
+ * Pull Requests where this check suite is applied.
51
+ *
52
+ * @return the list of pull requests
53
+ */
54
+ List <PartialPullRequestItem > pullRequests ();
44
55
}
Original file line number Diff line number Diff line change
1
+ /*-
2
+ * -\-\-
3
+ * github-api
4
+ * --
5
+ * Copyright (C) 2016 - 2020 Spotify AB
6
+ * --
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * -/-/-
19
+ */
20
+ package com .spotify .github .v3 .prs ;
21
+
22
+ import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
23
+ import com .fasterxml .jackson .databind .annotation .JsonSerialize ;
24
+ import com .spotify .github .CloseTracking ;
25
+ import com .spotify .github .GithubStyle ;
26
+ import org .immutables .value .Value ;
27
+
28
+ import javax .annotation .Nullable ;
29
+ import java .net .URI ;
30
+
31
+ @ Value .Immutable
32
+ @ GithubStyle
33
+ @ JsonSerialize (as = ImmutablePartialPullRequestItem .class )
34
+ @ JsonDeserialize (as = ImmutablePartialPullRequestItem .class )
35
+ public interface PartialPullRequestItem extends CloseTracking {
36
+ /** ID. */
37
+ Long id ();
38
+
39
+ /** URL. */
40
+ URI url ();
41
+
42
+ /** Number. */
43
+ Long number ();
44
+
45
+ /** Head reference. */
46
+ @ Nullable
47
+ PullRequestRef head ();
48
+
49
+ /** Base reference. */
50
+ @ Nullable
51
+ PullRequestRef base ();
52
+ }
Original file line number Diff line number Diff line change 23
23
import com .fasterxml .jackson .annotation .JsonProperty ;
24
24
import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
25
25
import com .fasterxml .jackson .databind .annotation .JsonSerialize ;
26
- import com .spotify .github .CloseTracking ;
27
26
import com .spotify .github .GitHubInstant ;
28
27
import com .spotify .github .GithubStyle ;
29
28
import com .spotify .github .v3 .Milestone ;
39
38
@ GithubStyle
40
39
@ JsonSerialize (as = ImmutablePullRequestItem .class )
41
40
@ JsonDeserialize (as = ImmutablePullRequestItem .class )
42
- public interface PullRequestItem extends CloseTracking {
43
-
44
- /** ID. */
45
- @ Nullable
46
- Long id ();
47
-
48
- /** URL. */
49
- @ Nullable
50
- URI url ();
41
+ public interface PullRequestItem extends PartialPullRequestItem {
51
42
52
43
/** HTML URL. */
53
44
@ Nullable
@@ -69,10 +60,6 @@ public interface PullRequestItem extends CloseTracking {
69
60
@ Nullable
70
61
URI commitsUrl ();
71
62
72
- /** Number. */
73
- @ Nullable
74
- Integer number ();
75
-
76
63
/** Either open, closed, or all to filter by state. Default: open. */
77
64
@ Nullable
78
65
String state ();
@@ -100,14 +87,6 @@ public interface PullRequestItem extends CloseTracking {
100
87
/** Merged date. */
101
88
Optional <GitHubInstant > mergedAt ();
102
89
103
- /** Head reference. */
104
- @ Nullable
105
- PullRequestRef head ();
106
-
107
- /** Base reference. */
108
- @ Nullable
109
- PullRequestRef base ();
110
-
111
90
/** User. */
112
91
@ Nullable
113
92
User user ();
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public void testDeserialization() throws IOException {
40
40
final PullRequestReviewEvent statusEvent =
41
41
Json .create ().fromJson (fixture , PullRequestReviewEvent .class );
42
42
assertThat (statusEvent .action (), is ("submitted" ));
43
- assertThat (statusEvent .pullRequest ().number (), is (8 ));
43
+ assertThat (statusEvent .pullRequest ().number (), is (8L ));
44
44
assertThat (statusEvent .review ().state (), is (ReviewState .APPROVED ));
45
45
}
46
46
}
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ public void listPullRequestsForCommit() throws Exception {
286
286
.thenReturn (fixture );
287
287
final List <PullRequestItem > prs = repoClient .listPullRequestsForCommit ("thesha" ).get ();
288
288
assertThat (prs .size (), is (1 ));
289
- assertThat (prs .get (0 ).number (), is (1347 ));
289
+ assertThat (prs .get (0 ).number (), is (1347L ));
290
290
}
291
291
292
292
@ Test
You can’t perform that action at this time.
0 commit comments