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

Now throws exception when tag lists are referenced when using the V3 API (#172).

parent 358f4221
...@@ -651,9 +651,7 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -651,9 +651,7 @@ public class ProjectApi extends AbstractApi implements Constants {
formData.withParam("public", isPublic); formData.withParam("public", isPublic);
if (project.getTagList() != null && !project.getTagList().isEmpty()) { if (project.getTagList() != null && !project.getTagList().isEmpty()) {
// What would be the preferred way to deal with this, as the V3 API doesn't throw new IllegalArgumentException("GitLab API v3 does not support tag lists when creating projects");
// appear to do anything if you send in the tag_list? Could either just ignore,
// or throw an exception.
} }
} else { } else {
Visibility visibility = (project.getVisibility() != null ? project.getVisibility() : Visibility visibility = (project.getVisibility() != null ? project.getVisibility() :
...@@ -892,9 +890,7 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -892,9 +890,7 @@ public class ProjectApi extends AbstractApi implements Constants {
formData.withParam("public", isPublic); formData.withParam("public", isPublic);
if (project.getTagList() != null && !project.getTagList().isEmpty()) { if (project.getTagList() != null && !project.getTagList().isEmpty()) {
// What would be the preferred way to deal with this, as the V3 API doesn't throw new IllegalArgumentException("GitLab API v3 does not support tag lists when updating projects");
// appear to do anything if you send in the tag_list? Could either just ignore,
// or throw an exception.
} }
} else { } else {
Visibility visibility = (project.getVisibility() != null ? project.getVisibility() : Visibility visibility = (project.getVisibility() != null ? project.getVisibility() :
......
...@@ -171,7 +171,7 @@ public class TestProjectApi { ...@@ -171,7 +171,7 @@ public class TestProjectApi {
.withWikiEnabled(true) .withWikiEnabled(true)
.withSnippetsEnabled(true) .withSnippetsEnabled(true)
.withVisibility(Visibility.PUBLIC) .withVisibility(Visibility.PUBLIC)
.withTagList(Arrays.asList("tag1","tag2")); .withTagList(Arrays.asList("tag1", "tag2"));
Project newProject = gitLabApi.getProjectApi().createProject(project); Project newProject = gitLabApi.getProjectApi().createProject(project);
assertNotNull(newProject); assertNotNull(newProject);
...@@ -196,7 +196,7 @@ public class TestProjectApi { ...@@ -196,7 +196,7 @@ public class TestProjectApi {
.withWikiEnabled(true) .withWikiEnabled(true)
.withSnippetsEnabled(true) .withSnippetsEnabled(true)
.withVisibility(Visibility.PUBLIC) .withVisibility(Visibility.PUBLIC)
.withTagList(Arrays.asList("tag1","tag2")); .withTagList(Arrays.asList("tag1", "tag2"));
Project newProject = gitLabApi.getProjectApi().createProject(project); Project newProject = gitLabApi.getProjectApi().createProject(project);
assertNotNull(newProject); assertNotNull(newProject);
......
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