Skip to content

Commit f454622

Browse files
committed
Added test for ImpersonationToken (#91).
1 parent 24d2f1f commit f454622

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.gitlab4j.api.models.Diff;
4040
import org.gitlab4j.api.models.Event;
4141
import org.gitlab4j.api.models.Group;
42+
import org.gitlab4j.api.models.ImpersonationToken;
4243
import org.gitlab4j.api.models.Issue;
4344
import org.gitlab4j.api.models.Job;
4445
import org.gitlab4j.api.models.Key;
@@ -405,6 +406,17 @@ public void testUser() {
405406
}
406407
}
407408

409+
@Test
410+
public void testImpersonationToken() {
411+
412+
try {
413+
ImpersonationToken token = makeFakeApiCall(ImpersonationToken.class, "impersonation-token");
414+
assertTrue(compareJson(token, "impersonation-token"));
415+
} catch (Exception e) {
416+
e.printStackTrace();
417+
}
418+
}
419+
408420
private <T> T makeFakeApiCall(Class<T> returnType, String file) throws JsonParseException, JsonMappingException, IOException {
409421

410422
InputStreamReader reader = new InputStreamReader(GitLabApi.class.getResourceAsStream(file + ".json"));

0 commit comments

Comments
 (0)