Commit 62e210eb authored by Greg Messner's avatar Greg Messner
Browse files

Added test.

parent d3788c8b
...@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals; ...@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assume.assumeTrue; import static org.junit.Assume.assumeTrue;
import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -11,6 +12,7 @@ import org.gitlab4j.api.GitLabApi.ApiVersion; ...@@ -11,6 +12,7 @@ import org.gitlab4j.api.GitLabApi.ApiVersion;
import org.gitlab4j.api.models.Event; import org.gitlab4j.api.models.Event;
import org.gitlab4j.api.models.Project; import org.gitlab4j.api.models.Project;
import org.gitlab4j.api.models.User; import org.gitlab4j.api.models.User;
import org.gitlab4j.api.utils.ISO8601;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
...@@ -92,12 +94,11 @@ public class TestEventsApi { ...@@ -92,12 +94,11 @@ public class TestEventsApi {
assumeTrue(gitLabApi != null); assumeTrue(gitLabApi != null);
} }
// This is commented out because it was causing a "Too Many Requests" error from gitlab.com, thus causing the tests to fail @Test
// @Test public void testGetAuthenticatedUserEvents() throws GitLabApiException {
// public void testGetAuthenticatedUserEvents() throws GitLabApiException { List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, null, null, null, null);
// List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, null, null, null, null); assertNotNull(events);
// assertNotNull(events); }
// }
@Test @Test
public void testGetAuthenticatedUserEventsWithDates() throws GitLabApiException { public void testGetAuthenticatedUserEventsWithDates() throws GitLabApiException {
...@@ -117,6 +118,15 @@ public class TestEventsApi { ...@@ -117,6 +118,15 @@ public class TestEventsApi {
List<Event> events = gitLabApi.getEventsApi().getUserEvents(testUser.getId(), null, null, null, null, null); List<Event> events = gitLabApi.getEventsApi().getUserEvents(testUser.getId(), null, null, null, null, null);
assertNotNull(events); assertNotNull(events);
} }
public void testGetUserEvents1() throws GitLabApiException, ParseException {
assertNotNull(testUser);
Date before = ISO8601.toDate("2018-06-02");
Date after = ISO8601.toDate("2018-05-01");
List<Event> events = gitLabApi.getEventsApi().getUserEvents(testUser.getId(), Constants.ActionType.CREATED, Constants.TargetType.PROJECT, before, after, Constants.SortOrder.DESC);
assertNotNull(events);
}
@Test @Test
public void testGetProjectEvents() throws GitLabApiException { public void testGetProjectEvents() throws GitLabApiException {
......
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