Skip to content

Update Mockito and JUnit #950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<servlet.version>6.0.0</servlet.version>
<activation.version>2.1.1</activation.version>

<junit.version>5.8.2</junit.version>
<junit.version>5.9.2</junit.version>
<testcontainers.version>1.15.3</testcontainers.version>
<mockito.version>4.4.0</mockito.version>
<mockito.version>5.2.0</mockito.version>
<hamcrest.version>1.3</hamcrest.version>
<systemRules.version>1.19.0</systemRules.version>

Expand Down Expand Up @@ -429,7 +429,7 @@
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<version>1.2.0</version>
<version>2.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void setUp() throws Exception {
response = new MockResponse(Discussion.class, null, "commit-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/gitlab4j/api/TestEpicDiscussionsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setUp() throws Exception {
response = new MockResponse(Discussion.class, null, "epic-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void initGetExternalStatusChecks() throws Exception, IOException {
response = new MockResponse(ExternalStatusCheck.class, null, "external-status-checks.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down Expand Up @@ -96,6 +96,6 @@ private void initGetExternalStatusCheckStatuses() throws Exception, IOException
response = new MockResponse(ExternalStatusCheckStatus.class, null, "external-status-check-statuses.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setUp() throws Exception {
response = new MockResponse(Discussion.class, null, "issue-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setUp() throws Exception {
response = new MockResponse(Discussion.class, null, "merge-request-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/gitlab4j/api/TestReleaseLinksApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ private void initGetLinks() throws Exception, IOException {
response = new MockResponse(Link.class, null, "links.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ private void init() throws Exception, IOException {
response = new MockResponse(Commit.class, "commit.json", null);
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.put(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.put(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setUp() throws Exception {
response = new MockResponse(Discussion.class, null, "snippet-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/gitlab4j/api/TestStreams.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setup() throws Exception {
response = new MockResponse(User.class, null, "user-list.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.<Object>any())).thenReturn(response);
when(gitLabApiClient.get(attributeCaptor.capture(), Mockito.any(Object[].class))).thenReturn(response);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void setUp() throws Exception {
when(mockGitLabApi.getApiClient()).thenReturn(mockedGitLabApiClient);

when(mockedGitLabApiClient.validateSecretToken(any())).thenReturn(true);
when(mockedGitLabApiClient.put(attributeCaptor.capture(), Mockito.<Object>any()))
when(mockedGitLabApiClient.put(attributeCaptor.capture(), Mockito.any(Object[].class)))
.thenReturn(mockedResponse);
}

Expand Down