Skip to content

Commit c8e9d10

Browse files
committed
Add test case for paginated LogsResponse
1 parent 967f0f3 commit c8e9d10

File tree

1 file changed

+13
-0
lines changed
  • slack-api-client/src/test/java/test_with_remote_apis/audit

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,17 @@ public void getLogs_dummy() throws IOException {
162162
}
163163
}
164164

165+
@Test
166+
public void getLogs_paginated() throws IOException, AuditApiException {
167+
if (orgAdminUserToken != null) {
168+
LogsResponse response = slack.audit(orgAdminUserToken).getLogs(req ->
169+
req.oldest(1521214343).action(Actions.User.user_login).limit(10));
170+
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));
173+
assertThat(cursor, not(equalTo(response.getResponseMetadata().getNextCursor())));
174+
assertThat(response, is(notNullValue()));
175+
}
176+
}
177+
165178
}

0 commit comments

Comments
 (0)