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
a6cdbbbc
Commit
a6cdbbbc
authored
Apr 23, 2019
by
Greg Messner
Browse files
Now limits number of events read during testing.
parent
eff93795
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/TestEventsApi.java
View file @
a6cdbbbc
...
@@ -96,7 +96,7 @@ public class TestEventsApi {
...
@@ -96,7 +96,7 @@ public class TestEventsApi {
@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
,
1
,
10
);
assertNotNull
(
events
);
assertNotNull
(
events
);
}
}
...
@@ -104,7 +104,7 @@ public class TestEventsApi {
...
@@ -104,7 +104,7 @@ public class TestEventsApi {
public
void
testGetAuthenticatedUserEventsWithDates
()
throws
GitLabApiException
{
public
void
testGetAuthenticatedUserEventsWithDates
()
throws
GitLabApiException
{
Date
after
=
new
Date
(
0
);
Date
after
=
new
Date
(
0
);
Date
now
=
new
Date
();
Date
now
=
new
Date
();
List
<
Event
>
events
=
gitLabApi
.
getEventsApi
().
getAuthenticatedUserEvents
(
null
,
null
,
now
,
after
,
null
);
List
<
Event
>
events
=
gitLabApi
.
getEventsApi
().
getAuthenticatedUserEvents
(
null
,
null
,
now
,
after
,
null
,
1
,
10
);
assertNotNull
(
events
);
assertNotNull
(
events
);
events
=
gitLabApi
.
getEventsApi
().
getAuthenticatedUserEvents
(
null
,
null
,
after
,
null
,
null
);
events
=
gitLabApi
.
getEventsApi
().
getAuthenticatedUserEvents
(
null
,
null
,
after
,
null
,
null
);
...
@@ -115,7 +115,7 @@ public class TestEventsApi {
...
@@ -115,7 +115,7 @@ public class TestEventsApi {
@Test
@Test
public
void
testGetUserEvents
()
throws
GitLabApiException
{
public
void
testGetUserEvents
()
throws
GitLabApiException
{
assertNotNull
(
testUser
);
assertNotNull
(
testUser
);
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
,
1
,
10
);
assertNotNull
(
events
);
assertNotNull
(
events
);
}
}
...
@@ -124,14 +124,15 @@ public class TestEventsApi {
...
@@ -124,14 +124,15 @@ public class TestEventsApi {
assertNotNull
(
testUser
);
assertNotNull
(
testUser
);
Date
before
=
ISO8601
.
toDate
(
"2017-06-02"
);
Date
before
=
ISO8601
.
toDate
(
"2017-06-02"
);
Date
after
=
new
Date
();
Date
after
=
new
Date
();
List
<
Event
>
events
=
gitLabApi
.
getEventsApi
().
getUserEvents
(
testUser
.
getId
(),
Constants
.
ActionType
.
CREATED
,
Constants
.
TargetType
.
PROJECT
,
before
,
after
,
Constants
.
SortOrder
.
DESC
);
List
<
Event
>
events
=
gitLabApi
.
getEventsApi
().
getUserEvents
(
testUser
.
getId
(),
Constants
.
ActionType
.
CREATED
,
Constants
.
TargetType
.
PROJECT
,
before
,
after
,
Constants
.
SortOrder
.
DESC
,
1
,
10
);
assertNotNull
(
events
);
assertNotNull
(
events
);
}
}
@Test
@Test
public
void
testGetProjectEvents
()
throws
GitLabApiException
{
public
void
testGetProjectEvents
()
throws
GitLabApiException
{
assertNotNull
(
testProject
);
assertNotNull
(
testProject
);
List
<
Event
>
events
=
gitLabApi
.
getEventsApi
().
getProjectEvents
(
testProject
.
getId
(),
null
,
null
,
null
,
null
,
null
);
List
<
Event
>
events
=
gitLabApi
.
getEventsApi
().
getProjectEvents
(
testProject
.
getId
(),
null
,
null
,
null
,
null
,
null
,
1
,
10
);
assertNotNull
(
events
);
assertNotNull
(
events
);
}
}
...
...
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