Commit fe2cc9aa authored by Greg Messner's avatar Greg Messner
Browse files

Updated PushData model and added test for same (#546)

parent 9a64bc73
......@@ -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_count;
private Integer commitCount;
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_count;
return commitCount;
}
@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));
......
......@@ -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");
......
[
{
"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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment