Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
aea03d34
Unverified
Commit
aea03d34
authored
Jun 14, 2023
by
Gautier de Saint Martin Lacaze
Committed by
GitHub
Jun 14, 2023
Browse files
Merge pull request #950 from jmini/update-mockito
Update Mockito and JUnit
parents
5d061641
fabfb5c0
Changes
11
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
aea03d34
...
...
@@ -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>
...
...
@@ -432,7 +432,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>
...
...
src/test/java/org/gitlab4j/api/TestCommitDiscussionsApi.java
View file @
aea03d34
...
...
@@ -35,7 +35,7 @@ public class TestCommitDiscussionsApi implements Constants {
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
...
...
src/test/java/org/gitlab4j/api/TestEpicDiscussionsApi.java
View file @
aea03d34
...
...
@@ -34,7 +34,7 @@ public class TestEpicDiscussionsApi implements Constants {
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
...
...
src/test/java/org/gitlab4j/api/TestExternalStatusCheckApi.java
View file @
aea03d34
...
...
@@ -64,7 +64,7 @@ public class TestExternalStatusCheckApi implements Constants {
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
...
...
@@ -96,6 +96,6 @@ public class TestExternalStatusCheckApi implements Constants {
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
);
}
}
src/test/java/org/gitlab4j/api/TestIssueDiscussionsApi.java
View file @
aea03d34
...
...
@@ -34,7 +34,7 @@ public class TestIssueDiscussionsApi implements Constants {
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
...
...
src/test/java/org/gitlab4j/api/TestMergeRequestDiscussionsApi.java
View file @
aea03d34
...
...
@@ -34,7 +34,7 @@ public class TestMergeRequestDiscussionsApi implements Constants {
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
...
...
src/test/java/org/gitlab4j/api/TestReleaseLinksApi.java
View file @
aea03d34
...
...
@@ -63,6 +63,6 @@ public class TestReleaseLinksApi implements Constants {
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
);
}
}
src/test/java/org/gitlab4j/api/TestRepositorySubmodulesApi.java
View file @
aea03d34
...
...
@@ -43,6 +43,6 @@ public class TestRepositorySubmodulesApi implements Constants {
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
);
}
}
src/test/java/org/gitlab4j/api/TestSnippetDiscussionsApi.java
View file @
aea03d34
...
...
@@ -34,7 +34,7 @@ public class TestSnippetDiscussionsApi implements Constants {
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
...
...
src/test/java/org/gitlab4j/api/TestStreams.java
View file @
aea03d34
...
...
@@ -48,7 +48,7 @@ public class TestStreams implements Constants {
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
...
...
src/test/java/org/gitlab4j/api/TestUnitMergeRequestApi.java
View file @
aea03d34
...
...
@@ -33,7 +33,7 @@ public class TestUnitMergeRequestApi {
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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment