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

Fix #810 : Change all model Ids to Long

parent bdc1f6d3
......@@ -70,7 +70,7 @@ public class TestServicesApi extends AbstractIntegrationTest {
@Test
public void testProjectIdOrPath() throws GitLabApiException {
Integer projectId = testProject.getId();
Long projectId = testProject.getId();
JiraService jiraServiceById = gitLabApi.getServicesApi().getJiraService(projectId);
assertNotNull(jiraServiceById);
JiraService jiraServiceByPath = gitLabApi.getServicesApi().getJiraService(testProject.getPathWithNamespace());
......
......@@ -39,28 +39,28 @@ public class TestSnippetDiscussionsApi implements Constants {
@Test
public void testGetSnippetDiscussionsByList() throws Exception {
List<Discussion> discussions = new DiscussionsApi(gitLabApi).getSnippetDiscussions(1, 1);
List<Discussion> discussions = new DiscussionsApi(gitLabApi).getSnippetDiscussions(1, 1L);
assertNotNull(discussions);
assertTrue(compareJson(discussions, "snippet-discussions.json"));
}
@Test
public void testGetSnippetDiscussionsByListWithMaxItems() throws Exception {
List<Discussion> discussions = new DiscussionsApi(gitLabApi).getSnippetDiscussions(1, 1, 20);
List<Discussion> discussions = new DiscussionsApi(gitLabApi).getSnippetDiscussions(1, 1L, 20);
assertNotNull(discussions);
assertTrue(compareJson(discussions, "snippet-discussions.json"));
}
@Test
public void testGetSnippetDiscussionsByPager() throws Exception {
Pager<Discussion> discussions = new DiscussionsApi(gitLabApi).getSnippetDiscussionsPager(1, 1, 20);
Pager<Discussion> discussions = new DiscussionsApi(gitLabApi).getSnippetDiscussionsPager(1, 1L, 20);
assertNotNull(discussions);
assertTrue(compareJson(discussions.all(), "snippet-discussions.json"));
}
@Test
public void testGetSnippetDiscussionsByStream() throws Exception {
Stream<Discussion> stream = new DiscussionsApi(gitLabApi).getSnippetDiscussionsStream(1, 1);
Stream<Discussion> stream = new DiscussionsApi(gitLabApi).getSnippetDiscussionsStream(1, 1L);
assertNotNull(stream);
List<Discussion> discussions = stream.collect(Collectors.toList());
assertTrue(compareJson(discussions, "snippet-discussions.json"));
......
......@@ -127,7 +127,7 @@ public class TestTodosApi extends AbstractIntegrationTest {
List<Todo> todos = gitLabApi.getTodosApi().getPendingTodos();
assertTrue(todos.size() > 0);
Integer foundId = null;
Long foundId = null;
for (Todo todo : todos) {
if (todo.isIssueTodo() && ((Issue)todo.getTarget()).getIid().intValue() == issue.getIid()) {
foundId = todo.getId();
......
......@@ -39,14 +39,14 @@ public class TestUnitMergeRequestApi {
@Test
public void whenAllArgumentsNull_thenNoAttributesSent() throws Exception {
new MergeRequestApi(mockGitLabApi).updateMergeRequest(1, 2, null, null, null, null, null, null,
new MergeRequestApi(mockGitLabApi).updateMergeRequest(1, 2L, null, null, null, null, null, null,
null, null, null, null, null);
assertEquals(0, attributeCaptor.getValue().size());
}
@Test
public void falseBooleansAreSerializedCorrectly() throws Exception {
new MergeRequestApi(mockGitLabApi).updateMergeRequest(1, 2, null, null, null, null, null, null,
new MergeRequestApi(mockGitLabApi).updateMergeRequest(1, 2L, null, null, null, null, null, null,
null, null, null, null, false);
assertThat(attributeCaptor.getValue(),
hasEntry("allow_collaboration", Collections.singletonList("false")));
......@@ -54,7 +54,7 @@ public class TestUnitMergeRequestApi {
@Test
public void trueBooleansAreSerializedCorrectly() throws Exception {
new MergeRequestApi(mockGitLabApi).updateMergeRequest(1, 2, null, null, null, null, null, null,
new MergeRequestApi(mockGitLabApi).updateMergeRequest(1, 2L, null, null, null, null, null, null,
null, null, null, null, true);
assertThat(attributeCaptor.getValue(),
hasEntry("allow_collaboration", Collections.singletonList("true")));
......
......@@ -298,7 +298,7 @@ public class TestUserApi extends AbstractIntegrationTest {
User user = gitLabApi.getUserApi().getCurrentUser();
assertNotNull(user);
assertEquals(TEST_SUDO_AS_USERNAME, user.getUsername());
Integer sudoAsId = user.getId();
Long sudoAsId = user.getId();
gitLabApi.sudo(null);
user = gitLabApi.getUserApi().getCurrentUser();
......@@ -366,7 +366,7 @@ public class TestUserApi extends AbstractIntegrationTest {
assertEquals(token.getId(), optional.get().getId());
gitLabApi.getUserApi().revokeImpersonationToken(user.getId(), token.getId());
optional = gitLabApi.getUserApi().getOptionalImpersonationToken(user.getId(), 123456);
optional = gitLabApi.getUserApi().getOptionalImpersonationToken(user.getId(), 123456L);
assertNotNull(optional);
assertFalse(optional.isPresent());
......@@ -452,7 +452,7 @@ public class TestUserApi extends AbstractIntegrationTest {
assertEquals(sshKey.getId(), optional.get().getId());
gitLabApi.getUserApi().deleteSshKey(sshKey.getId());
optional = gitLabApi.getUserApi().getOptionalSshKey(12345);
optional = gitLabApi.getUserApi().getOptionalSshKey(12345L);
assertNotNull(optional);
assertFalse(optional.isPresent());
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), GitLabApi.getOptionalException(optional).getHttpStatus());
......
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