Commit f4546228 authored by Greg Messner's avatar Greg Messner
Browse files

Added test for ImpersonationToken (#91).

parent 24d2f1fe
...@@ -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"));
......
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