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

Mods to support Issue clased_at property (#164).

parent 8647a1de
...@@ -18,6 +18,9 @@ public class Issue { ...@@ -18,6 +18,9 @@ public class Issue {
private Author author; private Author author;
private Boolean confidential; private Boolean confidential;
private Date createdAt; private Date createdAt;
private Date updatedAt;
private Date closedAt;
private User closedBy;
private String description; private String description;
private Date dueDate; private Date dueDate;
private Integer id; private Integer id;
...@@ -28,7 +31,6 @@ public class Issue { ...@@ -28,7 +31,6 @@ public class Issue {
private IssueState state; private IssueState state;
private Boolean subscribed; private Boolean subscribed;
private String title; private String title;
private Date updatedAt;
private Integer userNotesCount; private Integer userNotesCount;
private String webUrl; private String webUrl;
private TimeStats timeStats; private TimeStats timeStats;
...@@ -153,6 +155,22 @@ public class Issue { ...@@ -153,6 +155,22 @@ public class Issue {
this.updatedAt = updatedAt; this.updatedAt = updatedAt;
} }
public Date getClosedAt() {
return closedAt;
}
public void setClosedAt(Date closedAt) {
this.closedAt = closedAt;
}
public User getClosedBy() {
return closedBy;
}
public void setClosedBy(User closedBy) {
this.closedBy = closedBy;
}
public Integer getUserNotesCount() { public Integer getUserNotesCount() {
return userNotesCount; return userNotesCount;
} }
......
...@@ -202,6 +202,26 @@ public class TestIssuesApi { ...@@ -202,6 +202,26 @@ public class TestIssuesApi {
assertEquals(issue.getId(), closedIssue.getId()); assertEquals(issue.getId(), closedIssue.getId());
} }
@Test
public void testCloseIssueClosedAt() throws GitLabApiException {
assertNotNull(testProject);
Integer projectId = testProject.getId();
Issue issue = gitLabApi.getIssuesApi().createIssue(projectId, getUniqueTitle(), ISSUE_DESCRIPTION);
assertNull(issue.getClosedAt());
assertNull(issue.getClosedBy());
Issue closedIssue = gitLabApi.getIssuesApi().closeIssue(projectId, issue.getIid());
assertNotNull(closedIssue);
assertEquals(IssueState.CLOSED, closedIssue.getState());
assertEquals(issue.getId(), closedIssue.getId());
closedIssue = gitLabApi.getIssuesApi().getIssue(projectId, issue.getIid());
assertNotNull(closedIssue);
assertEquals(IssueState.CLOSED, closedIssue.getState());
assertNotNull(closedIssue.getClosedAt());
}
@Test @Test
public void testDeleteIssue() throws GitLabApiException { public void testDeleteIssue() throws GitLabApiException {
......
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
"title" : "Ut commodi ullam eos dolores perferendis nihil sunt.", "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
"updated_at" : "2016-01-04T15:31:46.176Z", "updated_at" : "2016-01-04T15:31:46.176Z",
"created_at" : "2016-01-04T15:31:46.176Z", "created_at" : "2016-01-04T15:31:46.176Z",
"closed_at" : "2016-01-05T15:31:46.176Z",
"closed_by" : {
"state" : "active",
"web_url" : "https://gitlab.example.com/root",
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
"subscribed": false, "subscribed": false,
"user_notes_count": 1, "user_notes_count": 1,
"web_url": "http://example.com/example/example/issues/1", "web_url": "http://example.com/example/example/issues/1",
......
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