Skip to content

Commit e28df48

Browse files
committed
Added test for fetching events with dates (#60).
1 parent 194c371 commit e28df48

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package org.gitlab4j.api;
22

3+
import static org.junit.Assert.assertEquals;
34
import static org.junit.Assert.assertNotNull;
45
import static org.junit.Assume.assumeTrue;
56

7+
import java.util.Date;
68
import java.util.List;
79

810
import org.gitlab4j.api.GitLabApi.ApiVersion;
@@ -81,6 +83,19 @@ public void testGetAuthenticatedUserEvents() throws GitLabApiException {
8183
assertNotNull(events);
8284
}
8385

86+
@Test
87+
public void testGetAuthenticatedUserEventsWithDates() throws GitLabApiException {
88+
89+
Date after = new Date(0);
90+
Date now = new Date();
91+
List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, null, now, after, null);
92+
assertNotNull(events);
93+
94+
events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, null, after, null, null);
95+
assertNotNull(events);
96+
assertEquals(0, events.size());
97+
}
98+
8499
@Test
85100
public void testGetUserEvents() throws GitLabApiException {
86101

0 commit comments

Comments
 (0)