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
fe2cc9aa
Commit
fe2cc9aa
authored
Apr 03, 2020
by
Greg Messner
Browse files
Updated PushData model and added test for same (#546)
parent
9a64bc73
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/PushData.java
View file @
fe2cc9aa
...
...
@@ -4,23 +4,38 @@ package org.gitlab4j.api.models;
import
org.gitlab4j.api.Constants.ActionType
;
import
org.gitlab4j.api.utils.JacksonJson
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
public
class
PushData
{
private
Integer
commit
_c
ount
;
private
Integer
commit
C
ount
;
private
ActionType
action
;
private
String
refType
;
private
String
commitFrom
;
private
String
commitTo
;
private
String
ref
;
private
String
commitTitle
;
@Deprecated
@JsonIgnore
public
Integer
getCommit_count
()
{
return
commit
_c
ount
;
return
commit
C
ount
;
}
@Deprecated
@JsonIgnore
public
void
setCommit_count
(
Integer
commit_count
)
{
this
.
commit_count
=
commit_count
;
this
.
commitCount
=
commit_count
;
}
public
Integer
getCommitCount
()
{
return
commitCount
;
}
public
void
setCommitCount
(
Integer
commit_count
)
{
this
.
commitCount
=
commit_count
;
}
public
ActionType
getAction
()
{
return
action
;
}
...
...
@@ -61,6 +76,14 @@ public class PushData {
this
.
ref
=
ref
;
}
public
String
getCommitTitle
()
{
return
commitTitle
;
}
public
void
setCommitTitle
(
String
commitTitle
)
{
this
.
commitTitle
=
commitTitle
;
}
@Override
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
...
...
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
View file @
fe2cc9aa
...
...
@@ -237,6 +237,12 @@ public class TestGitLabApiBeans {
assertTrue
(
compareJson
(
event
,
"event.json"
));
}
@Test
public
void
testEvents
()
throws
Exception
{
List
<
Event
>
events
=
unmarshalResourceList
(
Event
.
class
,
"events.json"
);
assertTrue
(
compareJson
(
events
,
"events.json"
));
}
@Test
public
void
testExportStatus
()
throws
Exception
{
ExportStatus
exportStatus
=
unmarshalResource
(
ExportStatus
.
class
,
"export-status.json"
);
...
...
src/test/resources/org/gitlab4j/api/events.json
0 → 100644
View file @
fe2cc9aa
[
{
"title"
:
"no title"
,
"project_id"
:
15
,
"action_name"
:
"closed"
,
"target_id"
:
830
,
"target_type"
:
"Issue"
,
"author_id"
:
1
,
"target_title"
:
"Public project search field"
,
"author"
:
{
"name"
:
"Dmitriy Zaporozhets"
,
"username"
:
"root"
,
"id"
:
1
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/fox_avatar.png"
,
"web_url"
:
"http://localhost:3000/root"
},
"author_username"
:
"root"
},
{
"title"
:
"no title 2"
,
"project_id"
:
15
,
"action_name"
:
"pushed"
,
"author_id"
:
1
,
"author"
:
{
"name"
:
"Dmitriy Zaporozhets"
,
"username"
:
"root"
,
"id"
:
1
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/fox_avatar.png"
,
"web_url"
:
"http://localhost:3000/root"
},
"author_username"
:
"john"
,
"push_data"
:
{
"commit_count"
:
1
,
"action"
:
"pushed"
,
"ref_type"
:
"branch"
,
"commit_from"
:
"50d4420237a9de7be1304607147aec22e4a14af7"
,
"commit_to"
:
"c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
"ref"
:
"master"
,
"commit_title"
:
"Add simple search to projects in public area"
}
},
{
"project_id"
:
15
,
"action_name"
:
"closed"
,
"target_id"
:
840
,
"target_type"
:
"Issue"
,
"author_id"
:
1
,
"target_title"
:
"Finish & merge Code search PR"
,
"author"
:
{
"name"
:
"Dmitriy Zaporozhets"
,
"username"
:
"root"
,
"id"
:
1
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/fox_avatar.png"
,
"web_url"
:
"http://localhost:3000/root"
},
"author_username"
:
"root"
},
{
"title"
:
"no title again"
,
"project_id"
:
15
,
"action_name"
:
"commented on"
,
"target_id"
:
1312
,
"target_type"
:
"Note"
,
"author_id"
:
1
,
"created_at"
:
"2015-12-04T10:33:58.089Z"
,
"note"
:
{
"id"
:
1312
,
"body"
:
"What an awesome day!"
,
"author"
:
{
"name"
:
"Dmitriy Zaporozhets"
,
"username"
:
"root"
,
"id"
:
1
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/fox_avatar.png"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2015-12-04T10:33:56.698Z"
,
"system"
:
false
,
"noteable_id"
:
377
,
"noteable_type"
:
"Issue"
},
"author"
:
{
"name"
:
"Dmitriy Zaporozhets"
,
"username"
:
"root"
,
"id"
:
1
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/fox_avatar.png"
,
"web_url"
:
"http://localhost:3000/root"
},
"author_username"
:
"root"
}
]
\ No newline at end of file
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