Unverified Commit 92441443 authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze
Browse files

Fix #829 : Some IDs parameter are still integer instead of long

parent b6b9ec4c
......@@ -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
......@@ -135,21 +135,6 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
......@@ -482,4 +467,29 @@
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>ossrh</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
......@@ -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<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
public List<Job> 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<List<Job>>() {}));
......@@ -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<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, JobScope scope) throws GitLabApiException {
public List<Job> 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<List<Job>>() {}));
......@@ -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<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, int itemsPerPage) throws GitLabApiException {
public Pager<Job> getJobsForPipeline(Object projectIdOrPath, long pipelineId, int itemsPerPage) throws GitLabApiException {
return (new Pager<Job>(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<Job> getJobsStream(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
public Stream<Job> getJobsStream(Object projectIdOrPath, long pipelineId) throws GitLabApiException {
return (getJobsForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage()).stream());
}
......
......@@ -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())
......
......@@ -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());
......
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