Unverified Commit aea03d34 authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze Committed by GitHub
Browse files

Merge pull request #950 from jmini/update-mockito

Update Mockito and JUnit
parents 5d061641 fabfb5c0
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<servlet.version>6.0.0</servlet.version> <servlet.version>6.0.0</servlet.version>
<activation.version>2.1.1</activation.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> <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> <hamcrest.version>1.3</hamcrest.version>
<systemRules.version>1.19.0</systemRules.version> <systemRules.version>1.19.0</systemRules.version>
...@@ -432,7 +432,7 @@ ...@@ -432,7 +432,7 @@
<dependency> <dependency>
<groupId>uk.org.webcompere</groupId> <groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId> <artifactId>system-stubs-jupiter</artifactId>
<version>1.2.0</version> <version>2.0.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -35,7 +35,7 @@ public class TestCommitDiscussionsApi implements Constants { ...@@ -35,7 +35,7 @@ public class TestCommitDiscussionsApi implements Constants {
response = new MockResponse(Discussion.class, null, "commit-discussions.json"); response = new MockResponse(Discussion.class, null, "commit-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
......
...@@ -34,7 +34,7 @@ public class TestEpicDiscussionsApi implements Constants { ...@@ -34,7 +34,7 @@ public class TestEpicDiscussionsApi implements Constants {
response = new MockResponse(Discussion.class, null, "epic-discussions.json"); response = new MockResponse(Discussion.class, null, "epic-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
......
...@@ -64,7 +64,7 @@ public class TestExternalStatusCheckApi implements Constants { ...@@ -64,7 +64,7 @@ public class TestExternalStatusCheckApi implements Constants {
response = new MockResponse(ExternalStatusCheck.class, null, "external-status-checks.json"); response = new MockResponse(ExternalStatusCheck.class, null, "external-status-checks.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
...@@ -96,6 +96,6 @@ public class TestExternalStatusCheckApi implements Constants { ...@@ -96,6 +96,6 @@ public class TestExternalStatusCheckApi implements Constants {
response = new MockResponse(ExternalStatusCheckStatus.class, null, "external-status-check-statuses.json"); response = new MockResponse(ExternalStatusCheckStatus.class, null, "external-status-check-statuses.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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);
} }
} }
...@@ -34,7 +34,7 @@ public class TestIssueDiscussionsApi implements Constants { ...@@ -34,7 +34,7 @@ public class TestIssueDiscussionsApi implements Constants {
response = new MockResponse(Discussion.class, null, "issue-discussions.json"); response = new MockResponse(Discussion.class, null, "issue-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
......
...@@ -34,7 +34,7 @@ public class TestMergeRequestDiscussionsApi implements Constants { ...@@ -34,7 +34,7 @@ public class TestMergeRequestDiscussionsApi implements Constants {
response = new MockResponse(Discussion.class, null, "merge-request-discussions.json"); response = new MockResponse(Discussion.class, null, "merge-request-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
......
...@@ -63,6 +63,6 @@ public class TestReleaseLinksApi implements Constants { ...@@ -63,6 +63,6 @@ public class TestReleaseLinksApi implements Constants {
response = new MockResponse(Link.class, null, "links.json"); response = new MockResponse(Link.class, null, "links.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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);
} }
} }
...@@ -43,6 +43,6 @@ public class TestRepositorySubmodulesApi implements Constants { ...@@ -43,6 +43,6 @@ public class TestRepositorySubmodulesApi implements Constants {
response = new MockResponse(Commit.class, "commit.json", null); response = new MockResponse(Commit.class, "commit.json", null);
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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);
} }
} }
...@@ -34,7 +34,7 @@ public class TestSnippetDiscussionsApi implements Constants { ...@@ -34,7 +34,7 @@ public class TestSnippetDiscussionsApi implements Constants {
response = new MockResponse(Discussion.class, null, "snippet-discussions.json"); response = new MockResponse(Discussion.class, null, "snippet-discussions.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
......
...@@ -48,7 +48,7 @@ public class TestStreams implements Constants { ...@@ -48,7 +48,7 @@ public class TestStreams implements Constants {
response = new MockResponse(User.class, null, "user-list.json"); response = new MockResponse(User.class, null, "user-list.json");
when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient); when(gitLabApi.getApiClient()).thenReturn(gitLabApiClient);
when(gitLabApiClient.validateSecretToken(any())).thenReturn(true); 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 @Test
......
...@@ -33,7 +33,7 @@ public class TestUnitMergeRequestApi { ...@@ -33,7 +33,7 @@ public class TestUnitMergeRequestApi {
when(mockGitLabApi.getApiClient()).thenReturn(mockedGitLabApiClient); when(mockGitLabApi.getApiClient()).thenReturn(mockedGitLabApiClient);
when(mockedGitLabApiClient.validateSecretToken(any())).thenReturn(true); 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); .thenReturn(mockedResponse);
} }
......
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