From 92441443a2f766e5e3eab234ce04ab92f1b4cded Mon Sep 17 00:00:00 2001 From: Gautier de Saint Martin Lacaze Date: Fri, 18 Mar 2022 15:05:47 +0100 Subject: [PATCH] Fix #829 : Some IDs parameter are still integer instead of long --- .github/workflows/ci-build.yml | 2 +- pom.xml | 40 ++++++++++++------- src/main/java/org/gitlab4j/api/JobApi.java | 8 ++-- .../gitlab4j/api/NotificationSettingsApi.java | 2 +- .../java/org/gitlab4j/api/TestUserApi.java | 10 ++--- 5 files changed, 36 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index c9e1c604..d5b06db5 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -43,4 +43,4 @@ jobs: - name: GitLab4j verify id: gitlab4j-verify run: | - ./mvnw integration-test -B -V -Dmaven.javadoc.skip=true + ./mvnw verify -B -V diff --git a/pom.xml b/pom.xml index 6d3f6ee9..dcb2a717 100644 --- a/pom.xml +++ b/pom.xml @@ -135,21 +135,6 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - org.apache.maven.plugins maven-source-plugin @@ -482,4 +467,29 @@ + + + ossrh + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + + + + + diff --git a/src/main/java/org/gitlab4j/api/JobApi.java b/src/main/java/org/gitlab4j/api/JobApi.java index f44d0bb4..1c8a6e80 100644 --- a/src/main/java/org/gitlab4j/api/JobApi.java +++ b/src/main/java/org/gitlab4j/api/JobApi.java @@ -139,7 +139,7 @@ public class JobApi extends AbstractApi implements Constants { * @return a list containing the jobs for the specified project ID and pipeline ID * @throws GitLabApiException if any exception occurs during execution */ - public List getJobsForPipeline(Object projectIdOrPath, int pipelineId) throws GitLabApiException { + public List getJobsForPipeline(Object projectIdOrPath, long pipelineId) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "jobs"); return (response.readEntity(new GenericType>() {})); @@ -156,7 +156,7 @@ public class JobApi extends AbstractApi implements Constants { * @return a list containing the jobs for the specified project ID and pipeline ID * @throws GitLabApiException if any exception occurs during execution */ - public List getJobsForPipeline(Object projectIdOrPath, int pipelineId, JobScope scope) throws GitLabApiException { + public List getJobsForPipeline(Object projectIdOrPath, long pipelineId, JobScope scope) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm().withParam("scope", scope).withParam(PER_PAGE_PARAM, getDefaultPerPage()); Response response = get(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "jobs"); return (response.readEntity(new GenericType>() {})); @@ -173,7 +173,7 @@ public class JobApi extends AbstractApi implements Constants { * @return a list containing the jobs for the specified project ID and pipeline ID * @throws GitLabApiException if any exception occurs during execution */ - public Pager getJobsForPipeline(Object projectIdOrPath, int pipelineId, int itemsPerPage) throws GitLabApiException { + public Pager getJobsForPipeline(Object projectIdOrPath, long pipelineId, int itemsPerPage) throws GitLabApiException { return (new Pager(this, Job.class, itemsPerPage, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "jobs")); } @@ -187,7 +187,7 @@ public class JobApi extends AbstractApi implements Constants { * @return a Stream containing the jobs for the specified project ID * @throws GitLabApiException if any exception occurs during execution */ - public Stream getJobsStream(Object projectIdOrPath, int pipelineId) throws GitLabApiException { + public Stream getJobsStream(Object projectIdOrPath, long pipelineId) throws GitLabApiException { return (getJobsForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage()).stream()); } diff --git a/src/main/java/org/gitlab4j/api/NotificationSettingsApi.java b/src/main/java/org/gitlab4j/api/NotificationSettingsApi.java index 99935647..1339daf6 100644 --- a/src/main/java/org/gitlab4j/api/NotificationSettingsApi.java +++ b/src/main/java/org/gitlab4j/api/NotificationSettingsApi.java @@ -133,7 +133,7 @@ public class NotificationSettingsApi extends AbstractApi { * @return a NotificationSettings instance containing the updated project notification settings * @throws GitLabApiException if any exception occurs */ - public NotificationSettings updateProjectNotificationSettings(int projectId, NotificationSettings settings) throws GitLabApiException { + public NotificationSettings updateProjectNotificationSettings(long projectId, NotificationSettings settings) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() .withParam("level", settings.getLevel()) diff --git a/src/test/java/org/gitlab4j/api/TestUserApi.java b/src/test/java/org/gitlab4j/api/TestUserApi.java index 76e727a2..16199dfe 100644 --- a/src/test/java/org/gitlab4j/api/TestUserApi.java +++ b/src/test/java/org/gitlab4j/api/TestUserApi.java @@ -553,21 +553,21 @@ public class TestUserApi extends AbstractIntegrationTest { assertEquals(3, memberships.size()); Membership membership1 = memberships.get(0); - assertMembershipEquals(membership1, 1, "test-project", MembershipSourceType.PROJECT, AccessLevel.MAINTAINER); + assertMembershipEquals(membership1, 1L, "test-project", MembershipSourceType.PROJECT, AccessLevel.MAINTAINER); Membership membership2 = memberships.get(1); - assertMembershipEquals(membership2, 4, "Test Group", MembershipSourceType.NAMESPACE, AccessLevel.OWNER); + assertMembershipEquals(membership2, 1L, "Test Group", MembershipSourceType.NAMESPACE, AccessLevel.OWNER); Membership membership3 = memberships.get(2); - assertMembershipEquals(membership3, 5, "subgroup", MembershipSourceType.NAMESPACE, AccessLevel.OWNER); + assertMembershipEquals(membership3, 1L, "subgroup", MembershipSourceType.NAMESPACE, AccessLevel.OWNER); } private void assertMembershipEquals(Membership actualMembership, - int expectedSourceId, + long expectedSourceId, String expectedSourceName, MembershipSourceType expectedSourceType, AccessLevel expectedAccessLevel) { - assertEquals(expectedSourceId, actualMembership.getSourceId().intValue()); + assertEquals(expectedSourceId, actualMembership.getSourceId()); assertEquals(expectedSourceName, actualMembership.getSourceName()); assertEquals(expectedSourceType, actualMembership.getSourceType()); assertEquals(expectedAccessLevel, actualMembership.getAccessLevel()); -- GitLab