Skip to content

Commit 7420c35

Browse files
authored
Fix Milestone class (#1060)
1 parent f2fe693 commit 7420c35

File tree

4 files changed

+40
-16
lines changed

4 files changed

+40
-16
lines changed

src/main/java/org/gitlab4j/api/models/Milestone.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
import org.gitlab4j.api.utils.JacksonJson;
66

7+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
8+
79
public class Milestone {
810

911
private Date createdAt;
1012
private String description;
13+
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
1114
private Date startDate;
15+
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
1216
private Date dueDate;
1317
private Long id;
1418
private Long iid;
@@ -17,6 +21,8 @@ public class Milestone {
1721
private String state;
1822
private String title;
1923
private Date updatedAt;
24+
private Boolean expired;
25+
private String webUrl;
2026

2127
public Date getCreatedAt() {
2228
return this.createdAt;
@@ -106,6 +112,22 @@ public void setUpdatedAt(Date updatedAt) {
106112
this.updatedAt = updatedAt;
107113
}
108114

115+
public Boolean getExpired() {
116+
return expired;
117+
}
118+
119+
public void setExpired(Boolean expired) {
120+
this.expired = expired;
121+
}
122+
123+
public String getWebUrl() {
124+
return webUrl;
125+
}
126+
127+
public void setWebUrl(String webUrl) {
128+
this.webUrl = webUrl;
129+
}
130+
109131
@Override
110132
public String toString() {
111133
return (JacksonJson.toJsonString(this));

src/test/resources/org/gitlab4j/api/milestone-group.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"group_id":14,
55
"title":"10.0",
66
"description":"Version",
7-
"start_date":"2013-11-01T00:00:00Z",
8-
"due_date":"2013-11-29T00:00:00Z",
7+
"start_date":"2013-11-01",
8+
"due_date":"2013-11-29",
99
"state":"active",
1010
"updated_at":"2013-10-02T09:24:18Z",
1111
"created_at":"2013-10-02T09:24:18Z"
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
2-
"id":12,
3-
"iid":3,
4-
"project_id":16,
5-
"title":"10.0",
6-
"description":"Version",
7-
"start_date":"2013-11-01T00:00:00Z",
8-
"due_date":"2013-11-29T00:00:00Z",
9-
"state":"active",
10-
"updated_at":"2013-10-02T09:24:18Z",
11-
"created_at":"2013-10-02T09:24:18Z"
2+
"id": 12,
3+
"iid": 3,
4+
"project_id": 16,
5+
"title": "1.0",
6+
"description": "Version",
7+
"state": "active",
8+
"created_at": "2013-10-02T09:24:18Z",
9+
"updated_at": "2013-10-02T09:24:18Z",
10+
"due_date": "2013-11-29",
11+
"start_date": "2013-11-01",
12+
"expired": false,
13+
"web_url": "http://gitlab.example.com/my-group/my-project/-/milestones/3"
1214
}

src/test/resources/org/gitlab4j/api/releases.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"state":"closed",
4141
"created_at":"2019-07-12T19:45:44.256Z",
4242
"updated_at":"2019-07-12T19:45:44.256Z",
43-
"due_date":"2019-08-16T11:00:00.256Z",
44-
"start_date":"2019-07-30T12:00:00.256Z"
43+
"due_date":"2019-08-16",
44+
"start_date":"2019-07-30"
4545
},
4646
{
4747
"id":52,
@@ -52,8 +52,8 @@
5252
"state":"closed",
5353
"created_at":"2019-07-16T14:00:12.256Z",
5454
"updated_at":"2019-07-16T14:00:12.256Z",
55-
"due_date":"2019-08-16T11:00:00.256Z",
56-
"start_date":"2019-07-30T12:00:00.256Z"
55+
"due_date":"2019-08-16",
56+
"start_date":"2019-07-30"
5757
}
5858
],
5959
"commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a",

0 commit comments

Comments
 (0)