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
f252531e
Commit
f252531e
authored
Apr 01, 2018
by
Greg Messner
Browse files
Mods to support Issue clased_at property (#164).
parent
8647a1de
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/Issue.java
View file @
f252531e
...
...
@@ -18,6 +18,9 @@ public class Issue {
private
Author
author
;
private
Boolean
confidential
;
private
Date
createdAt
;
private
Date
updatedAt
;
private
Date
closedAt
;
private
User
closedBy
;
private
String
description
;
private
Date
dueDate
;
private
Integer
id
;
...
...
@@ -28,7 +31,6 @@ public class Issue {
private
IssueState
state
;
private
Boolean
subscribed
;
private
String
title
;
private
Date
updatedAt
;
private
Integer
userNotesCount
;
private
String
webUrl
;
private
TimeStats
timeStats
;
...
...
@@ -153,6 +155,22 @@ public class Issue {
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
()
{
return
userNotesCount
;
}
...
...
src/test/java/org/gitlab4j/api/TestIssuesApi.java
View file @
f252531e
...
...
@@ -202,6 +202,26 @@ public class TestIssuesApi {
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
public
void
testDeleteIssue
()
throws
GitLabApiException
{
...
...
src/test/resources/org/gitlab4j/api/issue.json
View file @
f252531e
...
...
@@ -32,6 +32,14 @@
"title"
:
"Ut commodi ullam eos dolores perferendis nihil sunt."
,
"updated_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
,
"user_notes_count"
:
1
,
"web_url"
:
"http://example.com/example/example/issues/1"
,
...
...
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