Skip to content

Fix Milestone class #1060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Milestone.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

public class Milestone {

private Date createdAt;
private String description;
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
private Date startDate;
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
private Date dueDate;
private Long id;
private Long iid;
Expand All @@ -17,6 +21,8 @@ public class Milestone {
private String state;
private String title;
private Date updatedAt;
private Boolean expired;
private String webUrl;

public Date getCreatedAt() {
return this.createdAt;
Expand Down Expand Up @@ -106,6 +112,22 @@ public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}

public Boolean getExpired() {
return expired;
}

public void setExpired(Boolean expired) {
this.expired = expired;
}

public String getWebUrl() {
return webUrl;
}

public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/org/gitlab4j/api/milestone-group.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"group_id":14,
"title":"10.0",
"description":"Version",
"start_date":"2013-11-01T00:00:00Z",
"due_date":"2013-11-29T00:00:00Z",
"start_date":"2013-11-01",
"due_date":"2013-11-29",
"state":"active",
"updated_at":"2013-10-02T09:24:18Z",
"created_at":"2013-10-02T09:24:18Z"
Expand Down
22 changes: 12 additions & 10 deletions src/test/resources/org/gitlab4j/api/milestone.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"id":12,
"iid":3,
"project_id":16,
"title":"10.0",
"description":"Version",
"start_date":"2013-11-01T00:00:00Z",
"due_date":"2013-11-29T00:00:00Z",
"state":"active",
"updated_at":"2013-10-02T09:24:18Z",
"created_at":"2013-10-02T09:24:18Z"
"id": 12,
"iid": 3,
"project_id": 16,
"title": "1.0",
"description": "Version",
"state": "active",
"created_at": "2013-10-02T09:24:18Z",
"updated_at": "2013-10-02T09:24:18Z",
"due_date": "2013-11-29",
"start_date": "2013-11-01",
"expired": false,
"web_url": "http://gitlab.example.com/my-group/my-project/-/milestones/3"
}
8 changes: 4 additions & 4 deletions src/test/resources/org/gitlab4j/api/releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"state":"closed",
"created_at":"2019-07-12T19:45:44.256Z",
"updated_at":"2019-07-12T19:45:44.256Z",
"due_date":"2019-08-16T11:00:00.256Z",
"start_date":"2019-07-30T12:00:00.256Z"
"due_date":"2019-08-16",
"start_date":"2019-07-30"
},
{
"id":52,
Expand All @@ -52,8 +52,8 @@
"state":"closed",
"created_at":"2019-07-16T14:00:12.256Z",
"updated_at":"2019-07-16T14:00:12.256Z",
"due_date":"2019-08-16T11:00:00.256Z",
"start_date":"2019-07-30T12:00:00.256Z"
"due_date":"2019-08-16",
"start_date":"2019-07-30"
}
],
"commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a",
Expand Down