Skip to content

Commit e2663a7

Browse files
committed
Modify the Audit Logs API pagination test to be a bit more stable
1 parent c8e9d10 commit e2663a7

File tree

1 file changed

+11
-4
lines changed
  • slack-api-client/src/test/java/test_with_remote_apis/audit

1 file changed

+11
-4
lines changed

slack-api-client/src/test/java/test_with_remote_apis/audit/ApiTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,18 @@ public void getLogs_dummy() throws IOException {
165165
@Test
166166
public void getLogs_paginated() throws IOException, AuditApiException {
167167
if (orgAdminUserToken != null) {
168-
LogsResponse response = slack.audit(orgAdminUserToken).getLogs(req ->
169-
req.oldest(1521214343).action(Actions.User.user_login).limit(10));
168+
LogsResponse response = slack.audit(orgAdminUserToken).getLogs(req -> req
169+
.oldest(1521214343)
170+
.action(Actions.User.user_login)
171+
.limit(1)
172+
);
170173
String cursor = response.getResponseMetadata().getNextCursor();
171-
response = slack.audit(orgAdminUserToken).getLogs(req ->
172-
req.oldest(1521214343).action(Actions.User.user_login).limit(10).cursor(cursor));
174+
response = slack.audit(orgAdminUserToken).getLogs(req -> req
175+
.oldest(1521214343)
176+
.action(Actions.User.user_login)
177+
.limit(1)
178+
.cursor(cursor)
179+
);
173180
assertThat(cursor, not(equalTo(response.getResponseMetadata().getNextCursor())));
174181
assertThat(response, is(notNullValue()));
175182
}

0 commit comments

Comments
 (0)