Commit 55a20969 authored by Michal Sylwester's avatar Michal Sylwester

Make getMergeRequests pull all merge requests

parent 392c4455
...@@ -524,6 +524,11 @@ public class GitlabAPI { ...@@ -524,6 +524,11 @@ public class GitlabAPI {
retrieve().method("DELETE").to(tailUrl, Void.class); retrieve().method("DELETE").to(tailUrl, Void.class);
} }
public List<GitlabMergeRequest> getOpenMergeRequests(Serializable projectId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL + "?state=opened";
return retrieve().getAll(tailUrl, GitlabMergeRequest[].class);
}
public List<GitlabMergeRequest> getOpenMergeRequests(GitlabProject project) throws IOException { public List<GitlabMergeRequest> getOpenMergeRequests(GitlabProject project) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabMergeRequest.URL + "?state=opened"; String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabMergeRequest.URL + "?state=opened";
return retrieve().getAll(tailUrl, GitlabMergeRequest[].class); return retrieve().getAll(tailUrl, GitlabMergeRequest[].class);
...@@ -531,12 +536,12 @@ public class GitlabAPI { ...@@ -531,12 +536,12 @@ public class GitlabAPI {
public List<GitlabMergeRequest> getMergeRequests(Serializable projectId) throws IOException { public List<GitlabMergeRequest> getMergeRequests(Serializable projectId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL; String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL;
return fetchMergeRequests(tailUrl); return retrieve().getAll(tailUrl, GitlabMergeRequest[].class);
} }
public List<GitlabMergeRequest> getMergeRequests(GitlabProject project) throws IOException { public List<GitlabMergeRequest> getMergeRequests(GitlabProject project) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabMergeRequest.URL; String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabMergeRequest.URL;
return fetchMergeRequests(tailUrl); return retrieve().getAll(tailUrl, GitlabMergeRequest[].class);
} }
public List<GitlabMergeRequest> getAllMergeRequests(GitlabProject project) throws IOException { public List<GitlabMergeRequest> getAllMergeRequests(GitlabProject project) throws IOException {
...@@ -713,11 +718,6 @@ public class GitlabAPI { ...@@ -713,11 +718,6 @@ public class GitlabAPI {
retrieve().method("DELETE").to(tailUrl, Void.class); retrieve().method("DELETE").to(tailUrl, Void.class);
} }
private List<GitlabMergeRequest> fetchMergeRequests(String tailUrl) throws IOException {
GitlabMergeRequest[] mergeRequests = retrieve().to(tailUrl, GitlabMergeRequest[].class);
return Arrays.asList(mergeRequests);
}
public List<GitlabIssue> getIssues(GitlabProject project) throws IOException { public List<GitlabIssue> getIssues(GitlabProject project) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabIssue.URL; String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabIssue.URL;
return retrieve().getAll(tailUrl, GitlabIssue[].class); return retrieve().getAll(tailUrl, GitlabIssue[].class);
......
Markdown is supported
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