Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
c2929237
Unverified
Commit
c2929237
authored
Apr 19, 2023
by
Michael Fitoussi
Committed by
GitHub
Apr 19, 2023
Browse files
added reviewers to MergeRequestChanges (#958)
parent
69ba436c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/webhook/EventChanges.java
View file @
c2929237
...
...
@@ -114,12 +114,12 @@ public abstract class EventChanges {
}
@SuppressWarnings
(
"unchecked"
)
public
<
T
>
ChangeContainer
<
T
>
get
(
String
property
){
public
<
T
>
ChangeContainer
<
T
>
get
(
String
property
)
{
if
(
otherProperties
.
containsKey
(
property
)){
if
(
otherProperties
.
containsKey
(
property
))
{
try
{
final
ChangeContainer
<
Object
>
container
=
otherProperties
.
get
(
property
);
// noinspection unchecked :
It's duty from caller to be sure to do that
// noinspection unchecked : It's duty from caller to be sure to do that
return
container
!=
null
?
(
ChangeContainer
<
T
>)
container
:
null
;
}
catch
(
ClassCastException
e
)
{
return
null
;
...
...
src/main/java/org/gitlab4j/api/webhook/MergeRequestChanges.java
View file @
c2929237
package
org.gitlab4j.api.webhook
;
import
java.util.List
;
import
org.gitlab4j.api.models.Reviewer
;
public
class
MergeRequestChanges
extends
EventChanges
{
private
ChangeContainer
<
String
>
mergeStatus
;
private
ChangeContainer
<
List
<
Reviewer
>>
reviewers
;
public
ChangeContainer
<
String
>
getMergeStatus
()
{
return
mergeStatus
;
...
...
@@ -11,4 +16,13 @@ public class MergeRequestChanges extends EventChanges {
public
void
setMergeStatus
(
ChangeContainer
<
String
>
mergeStatus
)
{
this
.
mergeStatus
=
mergeStatus
;
}
public
ChangeContainer
<
List
<
Reviewer
>>
getReviewers
()
{
return
reviewers
;
}
public
void
setReviewers
(
ChangeContainer
<
List
<
Reviewer
>>
reviewers
)
{
this
.
reviewers
=
reviewers
;
}
}
src/test/resources/org/gitlab4j/api/merge-request-event.json
View file @
c2929237
...
...
@@ -131,56 +131,80 @@
],
"changes"
:
{
"author_id"
:
{
"current"
:
2
"current"
:
2
},
"updated_at"
:
{
"previous"
:
"2013-09-15T16:50:55Z"
,
"current"
:
"2013-12-03T17:23:34Z"
"previous"
:
"2013-09-15T16:50:55Z"
,
"current"
:
"2013-12-03T17:23:34Z"
},
"updated_by_id"
:
{
"previous"
:
2
,
"current"
:
6
"previous"
:
2
,
"current"
:
6
},
"id"
:{
"previous"
:
123
,
"current"
:
456
},
"iid"
:{
"previous"
:
12
,
"current"
:
34
"id"
:
{
"previous"
:
123
,
"current"
:
456
},
"iid"
:
{
"previous"
:
12
,
"current"
:
34
},
"merge_status"
:
{
"current"
:
"unchecked"
"current"
:
"unchecked"
},
"milestone_id"
:
{
"previous"
:
0
,
"current"
:
1
"previous"
:
0
,
"current"
:
1
},
"labels"
:
{
"previous"
:
[{
"id"
:
206
,
"title"
:
"API"
,
"color"
:
"#ffffff"
,
"project_id"
:
14
,
"created_at"
:
"2013-12-03T17:15:43Z"
,
"updated_at"
:
"2013-12-03T17:15:43Z"
,
"template"
:
false
,
"description"
:
"API related issues"
,
"type"
:
"ProjectLabel"
,
"group_id"
:
41
}],
"current"
:
[{
"id"
:
205
,
"title"
:
"Platform"
,
"color"
:
"#123123"
,
"project_id"
:
14
,
"created_at"
:
"2013-12-03T17:15:43Z"
,
"updated_at"
:
"2013-12-03T17:15:43Z"
,
"template"
:
false
,
"description"
:
"Platform related issues"
,
"type"
:
"ProjectLabel"
,
"group_id"
:
41
}]
"previous"
:
[
{
"id"
:
206
,
"title"
:
"API"
,
"color"
:
"#ffffff"
,
"project_id"
:
14
,
"created_at"
:
"2013-12-03T17:15:43Z"
,
"updated_at"
:
"2013-12-03T17:15:43Z"
,
"template"
:
false
,
"description"
:
"API related issues"
,
"type"
:
"ProjectLabel"
,
"group_id"
:
41
}
],
"current"
:
[
{
"id"
:
205
,
"title"
:
"Platform"
,
"color"
:
"#123123"
,
"project_id"
:
14
,
"created_at"
:
"2013-12-03T17:15:43Z"
,
"updated_at"
:
"2013-12-03T17:15:43Z"
,
"template"
:
false
,
"description"
:
"Platform related issues"
,
"type"
:
"ProjectLabel"
,
"group_id"
:
41
}
]
},
"reviewers"
:
{
"previous"
:
[
{
"id"
:
2
,
"name"
:
"John Doe"
,
"username"
:
"jdoe"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/0?s=80&d=identicon"
,
"email"
:
"jdoe@example.com"
}
],
"current"
:
[
{
"id"
:
3
,
"name"
:
"Paul Smith"
,
"username"
:
"psmith"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/0?s=80&d=identicon"
,
"email"
:
"psmith@example.com"
}
]
}
},
"assignees"
:
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment