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
4bd96b69
Commit
4bd96b69
authored
Dec 12, 2018
by
Greg Messner
Browse files
Initial commit (#279).
parent
2b91ecd4
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/DiscussionsApi.java
0 → 100644
View file @
4bd96b69
package
org.gitlab4j.api
;
import
java.util.List
;
import
java.util.stream.Stream
;
import
javax.ws.rs.core.GenericType
;
import
javax.ws.rs.core.Response
;
import
org.gitlab4j.api.models.Discussion
;
/**
* This class implements the client side API for the GitLab Discussions API.
* See <a href="https://docs.gitlab.com/ee/api/discussions.html">Discussions API at GitLab</a> for more information.
*/
public
class
DiscussionsApi
extends
AbstractApi
{
public
DiscussionsApi
(
GitLabApi
gitLabApi
)
{
super
(
gitLabApi
);
}
/**
* Get a list of all discussions for the specified issue.
*
* GET /projects/:id/issues/:issue_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of the issue
* @return a list containing all the discussions for the specified issue
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getIssueDiscussions
(
Object
projectIdOrPath
,
Integer
issueIid
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getIssueDiscussionsPager
(
projectIdOrPath
,
issueIid
,
getDefaultPerPage
());
return
(
pager
.
all
());
}
/**
* Get a list of discussions for the specified issue.
*
* GET /projects/:id/issues/:issue_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of the issue
* @param maxItems the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the issue
* @return a list containing the discussions for the specified issue
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getIssueDiscussions
(
Object
projectIdOrPath
,
Integer
issueIid
,
int
maxItems
)
throws
GitLabApiException
{
if
(
maxItems
<
1
)
{
return
(
getIssueDiscussions
(
projectIdOrPath
,
issueIid
));
}
else
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPerPageQueryParam
(
maxItems
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"discussions"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Discussion
>>()
{}));
}
}
/**
* Get a Pager of Discussion instances for the specified issue.
*
* GET /projects/:id/issues/:issue_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of the issue
* @param itemsPerPage the number of Discussion instances that will be fetched per page
* @return a Pager containing the Discussion instances for the specified issue
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Pager
<
Discussion
>
getIssueDiscussionsPager
(
Object
projectIdOrPath
,
Integer
issueIid
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Discussion
>(
this
,
Discussion
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"discussions"
));
}
/**
* Get a Stream of Discussion instances for the specified issue.
*
* GET /projects/:id/issues/:issue_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param issueIid the internal ID of the issue
* @return a Stream instance containing the Discussion instances for the specified issue
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Stream
<
Discussion
>
getIssueDiscussionsStream
(
Object
projectIdOrPath
,
Integer
issueIid
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getIssueDiscussionsPager
(
projectIdOrPath
,
issueIid
,
getDefaultPerPage
());
return
(
pager
.
stream
());
}
/**
* Get a list of all discussions for the specified snippet.
*
* GET /projects/:id/snippets/:snippet_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param snippetId the ID of the snippet
* @return a list containing all the discussions for the specified snippet
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getSnippetDiscussions
(
Object
projectIdOrPath
,
Integer
snippetId
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getSnippetDiscussionsPager
(
projectIdOrPath
,
snippetId
,
getDefaultPerPage
());
return
(
pager
.
all
());
}
/**
* Get a list of discussions for the specified snippet.
*
* GET /projects/:id/snippets/:snippet_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param snippetId the ID of the snippet
* @param maxItems the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the snippet
* @return a list containing the discussions for the specified snippet
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getSnippetDiscussions
(
Object
projectIdOrPath
,
Integer
snippetId
,
int
maxItems
)
throws
GitLabApiException
{
if
(
maxItems
<
1
)
{
return
(
getSnippetDiscussions
(
projectIdOrPath
,
snippetId
));
}
else
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPerPageQueryParam
(
maxItems
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"snippets"
,
snippetId
,
"discussions"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Discussion
>>()
{}));
}
}
/**
* Get a Pager of Discussion instances for the specified snippet.
*
* GET /projects/:id/snippets/:snippet_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param snippetId the ID of the snippet
* @param itemsPerPage the number of Discussion instances that will be fetched per page
* @return a Pager containing the Discussion instances for the specified snippet
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Pager
<
Discussion
>
getSnippetDiscussionsPager
(
Object
projectIdOrPath
,
Integer
snippetId
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Discussion
>(
this
,
Discussion
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"snippets"
,
snippetId
,
"discussions"
));
}
/**
* Get a Stream of Discussion instances for the specified snippet.
*
* GET /projects/:id/snippets/:snippet_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param snippetId the ID of the snippet
* @return a Stream instance containing the Discussion instances for the specified snippet
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Stream
<
Discussion
>
getSnippetDiscussionsStream
(
Object
projectIdOrPath
,
Integer
snippetId
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getSnippetDiscussionsPager
(
projectIdOrPath
,
snippetId
,
getDefaultPerPage
());
return
(
pager
.
stream
());
}
/**
* Get a list of all discussions for the specified epic.
*
* GET /projects/:id/epics/:epic_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param epicId the internal ID of the epic
* @return a list containing all the discussions for the specified epic
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getEpicDiscussions
(
Object
projectIdOrPath
,
Integer
epicId
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getEpicDiscussionsPager
(
projectIdOrPath
,
epicId
,
getDefaultPerPage
());
return
(
pager
.
all
());
}
/**
* Get a list of discussions for the specified epic.
*
* GET /projects/:id/epics/:epic_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param epicId the internal ID of the epic
* @param maxItems the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the epic
* @return a list containing the discussions for the specified epic
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getEpicDiscussions
(
Object
projectIdOrPath
,
Integer
epicId
,
int
maxItems
)
throws
GitLabApiException
{
if
(
maxItems
<
1
)
{
return
(
getEpicDiscussions
(
projectIdOrPath
,
epicId
));
}
else
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPerPageQueryParam
(
maxItems
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"epics"
,
epicId
,
"discussions"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Discussion
>>()
{}));
}
}
/**
* Get a Pager of Discussion instances for the specified epic.
*
* GET /projects/:id/epics/:epic_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param epicId the internal ID of the epic
* @param itemsPerPage the number of Discussion instances that will be fetched per page
* @return a Pager containing the Discussion instances for the specified epic
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Pager
<
Discussion
>
getEpicDiscussionsPager
(
Object
projectIdOrPath
,
Integer
epicId
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Discussion
>(
this
,
Discussion
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"epics"
,
epicId
,
"discussions"
));
}
/**
* Get a Stream of Discussion instances for the specified epic.
*
* GET /projects/:id/epics/:epic_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param epicId the internal ID of the epic
* @return a Stream instance containing the Discussion instances for the specified epic
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Stream
<
Discussion
>
getEpicDiscussionsStream
(
Object
projectIdOrPath
,
Integer
epicId
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getEpicDiscussionsPager
(
projectIdOrPath
,
epicId
,
getDefaultPerPage
());
return
(
pager
.
stream
());
}
/**
* Get a list of all discussions for the specified merge request.
*
* GET /projects/:id/merge_requests/:merge_request_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param mergeRequestIid the internal ID of the merge request
* @return a list containing all the discussions for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getMergeRequestDiscussions
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getMergeRequestDiscussionsPager
(
projectIdOrPath
,
mergeRequestIid
,
getDefaultPerPage
());
return
(
pager
.
all
());
}
/**
* Get a list of discussions for the specified merge request.
*
* GET /projects/:id/merge_requests/:merge_request_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param mergeRequestIid the internal ID of the merge request
* @param maxItems the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the merge request
* @return a list containing the discussions for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getMergeRequestDiscussions
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
int
maxItems
)
throws
GitLabApiException
{
if
(
maxItems
<
1
)
{
return
(
getMergeRequestDiscussions
(
projectIdOrPath
,
mergeRequestIid
));
}
else
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPerPageQueryParam
(
maxItems
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"merge_requests"
,
mergeRequestIid
,
"discussions"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Discussion
>>()
{}));
}
}
/**
* Get a Pager of Discussion instances for the specified merge request.
*
* GET /projects/:id/merge_requests/:merge_request_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param mergeRequestIid the internal ID of the merge request
* @param itemsPerPage the number of Discussion instances that will be fetched per page
* @return a Pager containing the Discussion instances for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Pager
<
Discussion
>
getMergeRequestDiscussionsPager
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Discussion
>(
this
,
Discussion
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"merge_requests"
,
mergeRequestIid
,
"discussions"
));
}
/**
* Get a Stream of Discussion instances for the specified merge request.
*
* GET /projects/:id/issues/:issue_iid/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param mergeRequestIid the internal ID of the merge request
* @return a Stream instance containing the Discussion instances for the specified issue
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Stream
<
Discussion
>
getMergeRequestDiscussionsStream
(
Object
projectIdOrPath
,
Integer
mergeRequestIid
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getMergeRequestDiscussionsPager
(
projectIdOrPath
,
mergeRequestIid
,
getDefaultPerPage
());
return
(
pager
.
stream
());
}
/**
* Get a list of all discussions for the specified commit.
*
* GET /projects/:id/commits/:commit_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param commitId the internal ID of the commit
* @return a list containing all the discussions for the specified commit
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getCommitDiscussions
(
Object
projectIdOrPath
,
Integer
commitId
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getCommitDiscussionsPager
(
projectIdOrPath
,
commitId
,
getDefaultPerPage
());
return
(
pager
.
all
());
}
/**
* Get a list of discussions for the specified commit.
*
* GET /projects/:id/commits/:commit_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param commitId the internal ID of the commit
* @param maxItems the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the commit
* @return a list containing the discussions for the specified commit
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
List
<
Discussion
>
getCommitDiscussions
(
Object
projectIdOrPath
,
Integer
commitId
,
int
maxItems
)
throws
GitLabApiException
{
if
(
maxItems
<
1
)
{
return
(
getCommitDiscussions
(
projectIdOrPath
,
commitId
));
}
else
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPerPageQueryParam
(
maxItems
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"commits"
,
commitId
,
"discussions"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Discussion
>>()
{}));
}
}
/**
* Get a Pager of Discussion instances for the specified commit.
*
* GET /projects/:id/commits/:commit_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param commitId the internal ID of the commit
* @param itemsPerPage the number of Discussion instances that will be fetched per page
* @return a Pager containing the Discussion instances for the specified commit
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Pager
<
Discussion
>
getCommitDiscussionsPager
(
Object
projectIdOrPath
,
Integer
commitId
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Discussion
>(
this
,
Discussion
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"commits"
,
commitId
,
"discussions"
));
}
/**
* Get a Stream of Discussion instances for the specified commit.
*
* GET /projects/:id/commits/:commit_id/discussions
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param commitId the internal ID of the commit
* @return a Stream instance containing the Discussion instances for the specified commit
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public
Stream
<
Discussion
>
getCommitDiscussionsStream
(
Object
projectIdOrPath
,
Integer
commitId
)
throws
GitLabApiException
{
Pager
<
Discussion
>
pager
=
getCommitDiscussionsPager
(
projectIdOrPath
,
commitId
,
getDefaultPerPage
());
return
(
pager
.
stream
());
}
}
src/test/java/org/gitlab4j/api/JsonUtils.java
0 → 100644
View file @
4bd96b69
package
org.gitlab4j.api
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.List
;
import
java.util.Map
;
import
org.gitlab4j.api.utils.JacksonJson
;
import
com.fasterxml.jackson.core.JsonParseException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.JsonMappingException
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.MapperFeature
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
public
class
JsonUtils
{
private
static
JacksonJson
jacksonJson
;
static
{
jacksonJson
=
new
JacksonJson
();
jacksonJson
.
getObjectMapper
().
configure
(
SerializationFeature
.
ORDER_MAP_ENTRIES_BY_KEYS
,
true
);
jacksonJson
.
getObjectMapper
().
configure
(
MapperFeature
.
SORT_PROPERTIES_ALPHABETICALLY
,
true
);
}
static
<
T
>
T
unmarshal
(
Class
<
T
>
returnType
,
String
filename
)
throws
JsonParseException
,
JsonMappingException
,
IOException
{
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
filename
));
return
(
jacksonJson
.
unmarshal
(
returnType
,
reader
));
}
static
<
T
>
List
<
T
>
unmarshalList
(
Class
<
T
>
returnType
,
String
filename
)
throws
JsonParseException
,
JsonMappingException
,
IOException
{
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
filename
));
return
(
jacksonJson
.
unmarshalList
(
returnType
,
reader
));
}
static
<
T
>
Map
<
String
,
T
>
unmarshalMap
(
Class
<
T
>
returnType
,
String
filename
)
throws
JsonParseException
,
JsonMappingException
,
IOException
{
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
filename
));
return
(
jacksonJson
.
unmarshalMap
(
returnType
,
reader
));
}
static
<
T
>
boolean
compareJson
(
T
apiObject
,
String
filename
)
throws
IOException
{
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
filename
));
String
objectJson
=
jacksonJson
.
marshal
(
apiObject
);
JsonNode
tree1
=
jacksonJson
.
getObjectMapper
().
readTree
(
objectJson
.
getBytes
());
JsonNode
tree2
=
jacksonJson
.
getObjectMapper
().
readTree
(
reader
);
boolean
sameJson
=
tree1
.
equals
(
tree2
);
if
(!
sameJson
)
{
System
.
err
.
println
(
"JSON did not match:"
);
sortedDump
(
tree1
);
sortedDump
(
tree2
);
}
return
(
sameJson
);
}
static
void
sortedDump
(
final
JsonNode
node
)
throws
JsonProcessingException
{
final
Object
obj
=
jacksonJson
.
getObjectMapper
().
treeToValue
(
node
,
Object
.
class
);
System
.
out
.
println
(
jacksonJson
.
getObjectMapper
().
writeValueAsString
(
obj
));
System
.
out
.
flush
();
}
}
src/test/resources/org/gitlab4j/api/commit-discussions.json
0 → 100644
View file @
4bd96b69
[
{
"id"
:
"6a9c1750b37d513a43987b574953fceb50b03ce7"
,
"individual_note"
:
false
,
"notes"
:
[
{
"id"
:
1126
,
"type"
:
"DiscussionNote"
,
"body"
:
"discussion text"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-03T21:54:39.668Z"
,
"updated_at"
:
"2018-03-03T21:54:39.668Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Commit"
,
"resolvable"
:
false
},
{
"id"
:
1129
,
"type"
:
"DiscussionNote"
,
"body"
:
"reply to the discussion"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T13:38:02.127Z"
,
"updated_at"
:
"2018-03-04T13:38:02.127Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Commit"
,
"resolvable"
:
false
}
]
},
{
"id"
:
"87805b7c09016a7058e91bdbe7b29d1f284a39e6"
,
"individual_note"
:
true
,
"notes"
:
[
{
"id"
:
1128
,
"body"
:
"a single comment"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T09:17:22.520Z"
,
"updated_at"
:
"2018-03-04T09:17:22.520Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Commit"
,
"resolvable"
:
false
}
]
}
]
\ No newline at end of file
src/test/resources/org/gitlab4j/api/epic-discussions.json
0 → 100644
View file @
4bd96b69
[
{
"id"
:
"6a9c1750b37d513a43987b574953fceb50b03ce7"
,
"individual_note"
:
false
,
"notes"
:
[
{
"id"
:
1126
,
"type"
:
"DiscussionNote"
,
"body"
:
"discussion text"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-03T21:54:39.668Z"
,
"updated_at"
:
"2018-03-03T21:54:39.668Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Epic"
,
"resolvable"
:
false
},
{
"id"
:
1129
,
"type"
:
"DiscussionNote"
,
"body"
:
"reply to the discussion"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T13:38:02.127Z"
,
"updated_at"
:
"2018-03-04T13:38:02.127Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Epic"
,
"resolvable"
:
false
}
]
},
{
"id"
:
"87805b7c09016a7058e91bdbe7b29d1f284a39e6"
,
"individual_note"
:
true
,
"notes"
:
[
{
"id"
:
1128
,
"body"
:
"a single comment"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T09:17:22.520Z"
,
"updated_at"
:
"2018-03-04T09:17:22.520Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Epic"
,
"resolvable"
:
false
}
]
}
]
\ No newline at end of file
src/test/resources/org/gitlab4j/api/issue-discussions.json
0 → 100644
View file @
4bd96b69
[
{
"id"
:
"6a9c1750b37d513a43987b574953fceb50b03ce7"
,
"individual_note"
:
false
,
"notes"
:
[
{
"id"
:
1126
,
"type"
:
"DiscussionNote"
,
"body"
:
"discussion text"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-03T21:54:39.668Z"
,
"updated_at"
:
"2018-03-03T21:54:39.668Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Issue"
},
{
"id"
:
1129
,
"type"
:
"DiscussionNote"
,
"body"
:
"reply to the discussion"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T13:38:02.127Z"
,
"updated_at"
:
"2018-03-04T13:38:02.127Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Issue"
,
"resolvable"
:
false
}
]
},
{
"id"
:
"87805b7c09016a7058e91bdbe7b29d1f284a39e6"
,
"individual_note"
:
true
,
"notes"
:
[
{
"id"
:
1128
,
"body"
:
"a single comment"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T09:17:22.520Z"
,
"updated_at"
:
"2018-03-04T09:17:22.520Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Issue"
,
"resolvable"
:
false
}
]
}
]
\ No newline at end of file
src/test/resources/org/gitlab4j/api/merge-request-discussions.json
0 → 100644
View file @
4bd96b69
[
{
"id"
:
"6a9c1750b37d513a43987b574953fceb50b03ce7"
,
"individual_note"
:
false
,
"notes"
:
[
{
"id"
:
1126
,
"type"
:
"DiscussionNote"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-03T21:54:39.668Z"
,
"updated_at"
:
"2018-03-03T21:54:39.668Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Merge request"
,
"resolved"
:
false
,
"resolvable"
:
true
},
{
"id"
:
1129
,
"type"
:
"DiscussionNote"
,
"body"
:
"reply to the discussion"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T13:38:02.127Z"
,
"updated_at"
:
"2018-03-04T13:38:02.127Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Merge request"
,
"resolved"
:
false
,
"resolvable"
:
true
}
]
},
{
"id"
:
"87805b7c09016a7058e91bdbe7b29d1f284a39e6"
,
"individual_note"
:
true
,
"notes"
:
[
{
"id"
:
1128
,
"body"
:
"a single comment"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T09:17:22.520Z"
,
"updated_at"
:
"2018-03-04T09:17:22.520Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Merge request"
,
"resolved"
:
false
,
"resolvable"
:
true
}
]
}
]
\ No newline at end of file
src/test/resources/org/gitlab4j/api/snippet-discussions.json
0 → 100644
View file @
4bd96b69
[
{
"id"
:
"6a9c1750b37d513a43987b574953fceb50b03ce7"
,
"individual_note"
:
false
,
"notes"
:
[
{
"id"
:
1126
,
"type"
:
"DiscussionNote"
,
"body"
:
"discussion text"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-03T21:54:39.668Z"
,
"updated_at"
:
"2018-03-03T21:54:39.668Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Snippet"
},
{
"id"
:
1129
,
"type"
:
"DiscussionNote"
,
"body"
:
"reply to the discussion"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T13:38:02.127Z"
,
"updated_at"
:
"2018-03-04T13:38:02.127Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Snippet"
,
"resolvable"
:
false
}
]
},
{
"id"
:
"87805b7c09016a7058e91bdbe7b29d1f284a39e6"
,
"individual_note"
:
true
,
"notes"
:
[
{
"id"
:
1128
,
"body"
:
"a single comment"
,
"author"
:
{
"id"
:
1
,
"name"
:
"root"
,
"username"
:
"root"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon"
,
"web_url"
:
"http://localhost:3000/root"
},
"created_at"
:
"2018-03-04T09:17:22.520Z"
,
"updated_at"
:
"2018-03-04T09:17:22.520Z"
,
"system"
:
false
,
"noteable_id"
:
3
,
"noteable_type"
:
"Snippet"
,
"resolvable"
:
false
}
]
}
]
\ No newline at end of file
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