Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
f4546228
Commit
f4546228
authored
7 years ago
by
Greg Messner
Browse files
Options
Download
Email Patches
Plain Diff
Added test for ImpersonationToken (#91).
parent
24d2f1fe
main
5.0.x
5.0.x.jdk17
6.x
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
+12
-0
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
with
12 additions
and
0 deletions
+12
-0
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
+
12
-
0
View file @
f4546228
...
...
@@ -39,6 +39,7 @@ import org.gitlab4j.api.models.DeployKey;
import
org.gitlab4j.api.models.Diff
;
import
org.gitlab4j.api.models.Event
;
import
org.gitlab4j.api.models.Group
;
import
org.gitlab4j.api.models.ImpersonationToken
;
import
org.gitlab4j.api.models.Issue
;
import
org.gitlab4j.api.models.Job
;
import
org.gitlab4j.api.models.Key
;
...
...
@@ -405,6 +406,17 @@ public class TestGitLabApiBeans {
}
}
@Test
public
void
testImpersonationToken
()
{
try
{
ImpersonationToken
token
=
makeFakeApiCall
(
ImpersonationToken
.
class
,
"impersonation-token"
);
assertTrue
(
compareJson
(
token
,
"impersonation-token"
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
<
T
>
T
makeFakeApiCall
(
Class
<
T
>
returnType
,
String
file
)
throws
JsonParseException
,
JsonMappingException
,
IOException
{
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
file
+
".json"
));
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets