File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
main/java/org/gitlab4j/api
test/java/org/gitlab4j/api Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ public String getApiNamespace() {
6767 private NamespaceApi namespaceApi ;
6868 private NotesApi notesApi ;
6969 private NotificationSettingsApi notificationSettingsApi ;
70+ private PackagesApi packagesApi ;
7071 private PipelineApi pipelineApi ;
7172 private ProjectApi projectApi ;
7273 private ProtectedBranchesApi protectedBranchesApi ;
@@ -1141,6 +1142,25 @@ public NotificationSettingsApi getNotificationSettingsApi() {
11411142 return (notificationSettingsApi );
11421143 }
11431144
1145+ /**
1146+ * Gets the PackagesApi instance owned by this GitLabApi instance. The PackagesApi is used
1147+ * to perform all Package related API calls.
1148+ *
1149+ * @return the PackagesApi instance owned by this GitLabApi instance
1150+ */
1151+ public PackagesApi getPackagesApi () {
1152+
1153+ if (packagesApi == null ) {
1154+ synchronized (this ) {
1155+ if (packagesApi == null ) {
1156+ packagesApi = new PackagesApi (this );
1157+ }
1158+ }
1159+ }
1160+
1161+ return (packagesApi );
1162+ }
1163+
11441164 /**
11451165 * Gets the PipelineApi instance owned by this GitLabApi instance. The PipelineApi is used
11461166 * to perform all pipeline related API calls.
Original file line number Diff line number Diff line change 6060import org .gitlab4j .api .models .Note ;
6161import org .gitlab4j .api .models .NotificationSettings ;
6262import org .gitlab4j .api .models .OauthTokenResponse ;
63+ import org .gitlab4j .api .models .Package ;
64+ import org .gitlab4j .api .models .PackageFile ;
6365import org .gitlab4j .api .models .Pipeline ;
6466import org .gitlab4j .api .models .PipelineSchedule ;
6567import org .gitlab4j .api .models .Project ;
@@ -204,6 +206,18 @@ public void testMergeRequestDiscussions() throws Exception {
204206 assertTrue (compareJson (discussions , "merge-request-discussions.json" ));
205207 }
206208
209+ @ Test
210+ public void testPackages () throws Exception {
211+ List <Package > packages = unmarshalResourceList (Package .class , "packages.json" );
212+ assertTrue (compareJson (packages , "packages.json" ));
213+ }
214+
215+ @ Test
216+ public void testPackageFiles () throws Exception {
217+ List <PackageFile > packageFiles = unmarshalResourceList (PackageFile .class , "package-files.json" );
218+ assertTrue (compareJson (packageFiles , "package-files.json" ));
219+ }
220+
207221 @ Test
208222 public void testSnippetDiscussions () throws Exception {
209223 List <Discussion > discussions = unmarshalResourceList (Discussion .class , "snippet-discussions.json" );
You can’t perform that action at this time.
0 commit comments