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
87ea8f6d
Commit
87ea8f6d
authored
Mar 19, 2019
by
Greg Messner
Browse files
Added support for the Packages API (#317).
parent
0e96088c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GitLabApi.java
View file @
87ea8f6d
...
...
@@ -67,6 +67,7 @@ public class GitLabApi {
private
NamespaceApi
namespaceApi
;
private
NotesApi
notesApi
;
private
NotificationSettingsApi
notificationSettingsApi
;
private
PackagesApi
packagesApi
;
private
PipelineApi
pipelineApi
;
private
ProjectApi
projectApi
;
private
ProtectedBranchesApi
protectedBranchesApi
;
...
...
@@ -1141,6 +1142,25 @@ public class GitLabApi {
return
(
notificationSettingsApi
);
}
/**
* Gets the PackagesApi instance owned by this GitLabApi instance. The PackagesApi is used
* to perform all Package related API calls.
*
* @return the PackagesApi instance owned by this GitLabApi instance
*/
public
PackagesApi
getPackagesApi
()
{
if
(
packagesApi
==
null
)
{
synchronized
(
this
)
{
if
(
packagesApi
==
null
)
{
packagesApi
=
new
PackagesApi
(
this
);
}
}
}
return
(
packagesApi
);
}
/**
* Gets the PipelineApi instance owned by this GitLabApi instance. The PipelineApi is used
* to perform all pipeline related API calls.
...
...
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
View file @
87ea8f6d
...
...
@@ -60,6 +60,8 @@ import org.gitlab4j.api.models.Milestone;
import
org.gitlab4j.api.models.Note
;
import
org.gitlab4j.api.models.NotificationSettings
;
import
org.gitlab4j.api.models.OauthTokenResponse
;
import
org.gitlab4j.api.models.Package
;
import
org.gitlab4j.api.models.PackageFile
;
import
org.gitlab4j.api.models.Pipeline
;
import
org.gitlab4j.api.models.PipelineSchedule
;
import
org.gitlab4j.api.models.Project
;
...
...
@@ -204,6 +206,18 @@ public class TestGitLabApiBeans {
assertTrue
(
compareJson
(
discussions
,
"merge-request-discussions.json"
));
}
@Test
public
void
testPackages
()
throws
Exception
{
List
<
Package
>
packages
=
unmarshalResourceList
(
Package
.
class
,
"packages.json"
);
assertTrue
(
compareJson
(
packages
,
"packages.json"
));
}
@Test
public
void
testPackageFiles
()
throws
Exception
{
List
<
PackageFile
>
packageFiles
=
unmarshalResourceList
(
PackageFile
.
class
,
"package-files.json"
);
assertTrue
(
compareJson
(
packageFiles
,
"package-files.json"
));
}
@Test
public
void
testSnippetDiscussions
()
throws
Exception
{
List
<
Discussion
>
discussions
=
unmarshalResourceList
(
Discussion
.
class
,
"snippet-discussions.json"
);
...
...
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