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
f4546228
Commit
f4546228
authored
Nov 05, 2017
by
Greg Messner
Browse files
Added test for ImpersonationToken (#91).
parent
24d2f1fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
View file @
f4546228
...
@@ -39,6 +39,7 @@ import org.gitlab4j.api.models.DeployKey;
...
@@ -39,6 +39,7 @@ import org.gitlab4j.api.models.DeployKey;
import
org.gitlab4j.api.models.Diff
;
import
org.gitlab4j.api.models.Diff
;
import
org.gitlab4j.api.models.Event
;
import
org.gitlab4j.api.models.Event
;
import
org.gitlab4j.api.models.Group
;
import
org.gitlab4j.api.models.Group
;
import
org.gitlab4j.api.models.ImpersonationToken
;
import
org.gitlab4j.api.models.Issue
;
import
org.gitlab4j.api.models.Issue
;
import
org.gitlab4j.api.models.Job
;
import
org.gitlab4j.api.models.Job
;
import
org.gitlab4j.api.models.Key
;
import
org.gitlab4j.api.models.Key
;
...
@@ -405,6 +406,17 @@ public class TestGitLabApiBeans {
...
@@ -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
{
private
<
T
>
T
makeFakeApiCall
(
Class
<
T
>
returnType
,
String
file
)
throws
JsonParseException
,
JsonMappingException
,
IOException
{
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
file
+
".json"
));
InputStreamReader
reader
=
new
InputStreamReader
(
GitLabApi
.
class
.
getResourceAsStream
(
file
+
".json"
));
...
...
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