Skip to content

Commit a87bd5c

Browse files
committed
Run all the integration tests - 2022-11-16 PT
1 parent 6bcd0b5 commit a87bd5c

File tree

12 files changed

+504
-300
lines changed

12 files changed

+504
-300
lines changed

json-logs/samples/api/chat.postMessage.json

Lines changed: 385 additions & 200 deletions
Large diffs are not rendered by default.

json-logs/samples/api/files.list.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,14 @@
2323
"username": "",
2424
"url_private": "https://www.example.com/",
2525
"url_private_download": "https://www.example.com/",
26-
"media_display_type": "",
27-
"thumb_64": "https://www.example.com/",
28-
"thumb_80": "https://www.example.com/",
29-
"thumb_360": "https://www.example.com/",
30-
"thumb_360_w": 12345,
31-
"thumb_360_h": 12345,
32-
"thumb_160": "https://www.example.com/",
33-
"original_w": 12345,
34-
"original_h": 12345,
35-
"thumb_tiny": "",
3626
"permalink": "https://www.example.com/",
3727
"permalink_public": "https://www.example.com/",
38-
"alt_txt": "",
28+
"edit_link": "https://www.example.com/",
29+
"preview": "",
30+
"preview_highlight": "",
31+
"lines": 12345,
32+
"lines_more": 12345,
33+
"preview_is_truncated": false,
3934
"channels": [
4035
"C00000000",
4136
""
@@ -47,27 +42,32 @@
4742
""
4843
],
4944
"comments_count": 12345,
50-
"edit_link": "https://www.example.com/",
51-
"preview": "",
52-
"preview_highlight": "",
53-
"lines": 12345,
54-
"lines_more": 12345,
55-
"preview_is_truncated": false,
45+
"media_display_type": "",
46+
"thumb_64": "https://www.example.com/",
47+
"thumb_80": "https://www.example.com/",
48+
"thumb_360": "https://www.example.com/",
49+
"thumb_360_w": 12345,
50+
"thumb_360_h": 12345,
51+
"thumb_160": "https://www.example.com/",
52+
"thumb_800": "https://www.example.com/",
53+
"thumb_800_w": 12345,
54+
"thumb_800_h": 12345,
55+
"original_w": 12345,
56+
"original_h": 12345,
57+
"thumb_tiny": "",
5658
"thumb_480": "https://www.example.com/",
5759
"thumb_480_w": 12345,
5860
"thumb_480_h": 12345,
5961
"thumb_720": "https://www.example.com/",
6062
"thumb_720_w": 12345,
6163
"thumb_720_h": 12345,
62-
"thumb_800": "https://www.example.com/",
63-
"thumb_800_w": 12345,
64-
"thumb_800_h": 12345,
6564
"thumb_960": "https://www.example.com/",
6665
"thumb_960_w": 12345,
6766
"thumb_960_h": 12345,
6867
"thumb_1024": "https://www.example.com/",
6968
"thumb_1024_w": 12345,
7069
"thumb_1024_h": 12345,
70+
"alt_txt": "",
7171
"thumb_360_gif": "https://www.example.com/",
7272
"thumb_480_gif": "https://www.example.com/",
7373
"deanimate": "https://www.example.com/",

json-logs/samples/api/files.remote.list.json

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,64 @@
22
"ok": false,
33
"files": [
44
{
5-
"id": "",
5+
"id": "F00000000",
66
"created": 12345,
77
"timestamp": 12345,
88
"name": "",
99
"title": "",
10-
"subject": "",
1110
"mimetype": "",
1211
"filetype": "",
1312
"pretty_type": "",
14-
"user": "",
15-
"user_team": "",
16-
"mode": "",
13+
"user": "U00000000",
14+
"user_team": "T00000000",
1715
"editable": false,
16+
"size": 12345,
17+
"mode": "",
18+
"is_external": false,
19+
"external_type": "",
20+
"is_public": false,
21+
"public_url_shared": false,
22+
"display_as_bot": false,
23+
"username": "",
24+
"url_private": "https://www.example.com/",
25+
"media_display_type": "",
26+
"thumb_64": "https://www.example.com/",
27+
"thumb_80": "https://www.example.com/",
28+
"thumb_360": "https://www.example.com/",
29+
"thumb_360_w": 12345,
30+
"thumb_360_h": 12345,
31+
"thumb_480": "https://www.example.com/",
32+
"thumb_480_w": 12345,
33+
"thumb_480_h": 12345,
34+
"thumb_160": "https://www.example.com/",
35+
"thumb_720": "https://www.example.com/",
36+
"thumb_720_w": 12345,
37+
"thumb_720_h": 12345,
38+
"thumb_800": "https://www.example.com/",
39+
"thumb_800_w": 12345,
40+
"thumb_800_h": 12345,
41+
"thumb_960": "https://www.example.com/",
42+
"thumb_960_w": 12345,
43+
"thumb_960_h": 12345,
44+
"thumb_1024": "https://www.example.com/",
45+
"thumb_1024_w": 12345,
46+
"thumb_1024_h": 12345,
47+
"image_exif_rotation": 12345,
48+
"original_w": 12345,
49+
"original_h": 12345,
50+
"thumb_tiny": "",
51+
"permalink": "https://www.example.com/",
52+
"channels": [
53+
""
54+
],
55+
"groups": [
56+
""
57+
],
58+
"ims": [
59+
""
60+
],
61+
"comments_count": 12345,
62+
"subject": "",
1863
"non_owner_editable": false,
1964
"editor": "",
2065
"last_editor": "",
@@ -34,70 +79,38 @@
3479
"thumb_video_w": 12345,
3580
"thumb_video_h": 12345,
3681
"original_attachment_count": 12345,
37-
"is_external": false,
38-
"external_type": "",
3982
"external_id": "",
4083
"external_url": "",
41-
"username": "",
42-
"size": 12345,
43-
"url_private": "",
4484
"url_private_download": "",
4585
"app_id": "",
4686
"app_name": "",
47-
"thumb_64": "",
4887
"thumb_64_gif": "",
4988
"thumb_64_w": "",
5089
"thumb_64_h": "",
51-
"thumb_80": "",
5290
"thumb_80_gif": "",
5391
"thumb_80_w": "",
5492
"thumb_80_h": "",
55-
"thumb_160": "",
5693
"thumb_160_gif": "",
5794
"thumb_160_w": "",
5895
"thumb_160_h": "",
59-
"thumb_360": "",
6096
"thumb_360_gif": "",
61-
"thumb_360_w": "",
62-
"thumb_360_h": "",
63-
"thumb_480": "",
6497
"thumb_480_gif": "",
65-
"thumb_480_w": "",
66-
"thumb_480_h": "",
67-
"thumb_720": "",
6898
"thumb_720_gif": "",
69-
"thumb_720_w": "",
70-
"thumb_720_h": "",
71-
"thumb_800": "",
7299
"thumb_800_gif": "",
73-
"thumb_800_w": "",
74-
"thumb_800_h": "",
75-
"thumb_960": "",
76100
"thumb_960_gif": "",
77-
"thumb_960_w": "",
78-
"thumb_960_h": "",
79-
"thumb_1024": "",
80101
"thumb_1024_gif": "",
81-
"thumb_1024_w": "",
82-
"thumb_1024_h": "",
83102
"thumb_video": "",
84103
"thumb_gif": "",
85104
"thumb_pdf": "",
86105
"thumb_pdf_w": "",
87106
"thumb_pdf_h": "",
88-
"thumb_tiny": "",
89107
"converted_pdf": "",
90-
"image_exif_rotation": 12345,
91-
"original_w": "",
92-
"original_h": "",
93108
"deanimate": "",
94109
"deanimate_gif": "",
95110
"pjpeg": "",
96-
"permalink": "",
97111
"permalink_public": "",
98112
"edit_link": "",
99113
"has_rich_preview": false,
100-
"media_display_type": "",
101114
"preview_is_truncated": false,
102115
"preview": "",
103116
"preview_highlight": "",
@@ -107,18 +120,6 @@
107120
"sent_to_self": false,
108121
"lines": 12345,
109122
"lines_more": 12345,
110-
"is_public": false,
111-
"public_url_shared": false,
112-
"display_as_bot": false,
113-
"channels": [
114-
""
115-
],
116-
"groups": [
117-
""
118-
],
119-
"ims": [
120-
""
121-
],
122123
"shares": {
123124
"public": {
124125
"C00000000": [
@@ -239,8 +240,7 @@
239240
],
240241
"url": ""
241242
}
242-
],
243-
"comments_count": 12345
243+
]
244244
}
245245
],
246246
"response_metadata": {

json-logs/samples/api/search.all.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6833,7 +6833,8 @@
68336833
}
68346834
},
68356835
"channels": [
6836-
"C00000000"
6836+
"C00000000",
6837+
""
68376838
],
68386839
"groups": [
68396840
""

json-logs/samples/api/search.files.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@
107107
}
108108
},
109109
"channels": [
110-
"C00000000"
110+
"C00000000",
111+
""
111112
],
112113
"groups": [
113114
""

slack-api-client/src/test/java/test_with_remote_apis/methods/bots_Test.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ public static void tearDown() throws InterruptedException {
4848
private static String cachedBotId = null;
4949

5050
@BeforeClass
51-
public static void loadBotId() throws IOException, SlackApiException {
51+
public static void loadBotId() throws Exception {
5252
if (cachedBotId == null) {
53-
List<User> users = slack.methods(botToken).usersList(req -> req).getMembers();
53+
// Using async client to avoid an exception due to rate limited errors
54+
List<User> users = slack.methodsAsync(botToken).usersList(req -> req).get().getMembers();
5455
User user = null;
5556
for (User u : users) {
5657
if (u.isBot() && !"USLACKBOT".equals(u.getId())) {
@@ -62,7 +63,7 @@ public static void loadBotId() throws IOException, SlackApiException {
6263
}
6364
}
6465

65-
String findBotId() throws IOException, SlackApiException {
66+
String findBotId() throws Exception {
6667
if (cachedBotId == null) {
6768
loadBotId();
6869
}
@@ -77,7 +78,7 @@ public void botsInfoError() throws IOException, SlackApiException {
7778
}
7879

7980
@Test
80-
public void botsInfo() throws IOException, SlackApiException {
81+
public void botsInfo() throws Exception {
8182
String botId = findBotId();
8283
BotsInfoResponse response = slack.methods(botToken).botsInfo(req -> req.bot(botId));
8384
assertThat(response.getError(), is(nullValue()));

slack-api-client/src/test/java/test_with_remote_apis/methods/calls_Test.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public void testAll() throws Exception {
6464
String botToken = System.getenv(Constants.SLACK_SDK_TEST_BOT_TOKEN);
6565
String uniqueId = UUID.randomUUID().toString();
6666
String joinUrl = "https://www.example.com/calls-test";
67-
List<String> userIds = slack.methods(botToken).usersList(r -> r.limit(50))
67+
// Using async client to avoid an exception due to rate limited errors
68+
List<String> userIds = slack.methodsAsync(botToken).usersList(r -> r.limit(50))
69+
.get()
6870
.getMembers().stream()
6971
.filter(u -> !u.isDeleted() && !u.isBot())
7072
.map(u -> u.getId())
@@ -137,7 +139,7 @@ public void testAll() throws Exception {
137139
}
138140

139141
@Test
140-
public void errors() throws IOException, SlackApiException {
142+
public void errors() throws Exception {
141143
String botToken = System.getenv(Constants.SLACK_SDK_TEST_BOT_TOKEN);
142144
CallsAddResponse callCreation = slack.methods(botToken).callsAdd(r -> r
143145
.title("Test call")
@@ -149,7 +151,9 @@ public void errors() throws IOException, SlackApiException {
149151

150152
String uniqueId = UUID.randomUUID().toString();
151153
String joinUrl = "https://www.example.com/calls-test";
152-
List<String> userIds = slack.methods(botToken).usersList(r -> r.limit(50))
154+
// Using async client to avoid an exception due to rate limited errors
155+
List<String> userIds = slack.methodsAsync(botToken).usersList(r -> r.limit(50))
156+
.get()
153157
.getMembers().stream()
154158
.filter(u -> !u.isDeleted() && !u.isBot())
155159
.map(u -> u.getId())

slack-api-client/src/test/java/test_with_remote_apis/methods/conversations_Test.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static void tearDown() throws InterruptedException {
5050
}
5151

5252
@Test
53-
public void channelConversation() throws IOException, SlackApiException {
53+
public void channelConversation() throws Exception {
5454

5555
{
5656
ConversationsListResponse listResponse = slack.methods().conversationsList(
@@ -226,8 +226,9 @@ public void channelConversation() throws IOException, SlackApiException {
226226
assertThat(membersResponse.getMembers().isEmpty(), is(false));
227227
assertThat(membersResponse.getResponseMetadata(), is(notNullValue()));
228228

229-
UsersListResponse usersListResponse = slack.methods().usersList(r -> r
230-
.token(botToken));
229+
// Using async client to avoid an exception due to rate limited errors
230+
UsersListResponse usersListResponse = slack.methodsAsync().usersList(r -> r
231+
.token(botToken)).get();
231232
String invitee_ = null;
232233
for (User u : usersListResponse.getMembers()) {
233234
if (!"USLACKBOT".equals(u.getId())
@@ -301,9 +302,10 @@ public void channelConversation() throws IOException, SlackApiException {
301302
}
302303

303304
@Test
304-
public void imConversation() throws IOException, SlackApiException {
305+
public void imConversation() throws Exception {
305306

306-
UsersListResponse usersListResponse = slack.methods().usersList(r -> r.token(botToken));
307+
// Using async client to avoid an exception due to rate limited errors
308+
UsersListResponse usersListResponse = slack.methodsAsync().usersList(r -> r.token(botToken)).get();
307309
List<User> users = usersListResponse.getMembers();
308310
String userId = users.get(0).getId();
309311

slack-api-client/src/test/java/test_with_remote_apis/methods/dnd_Test.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ public static void tearDown() throws InterruptedException {
3838
}
3939

4040
@Test
41-
public void dnd() throws IOException, SlackApiException {
42-
List<User> members = slack.methods().usersList(r -> r.token(botToken).presence(true)).getMembers();
41+
public void dnd() throws Exception {
42+
// Using async client to avoid an exception due to rate limited errors
43+
List<User> members = slack.methodsAsync().usersList(r -> r.token(botToken).presence(true)).get().getMembers();
4344
{
4445
String user = members.get(0).getId();
4546
DndInfoResponse response = slack.methods().dndInfo(r -> r.token(botToken).user(user));

slack-api-client/src/test/java/test_with_remote_apis/methods/reactions_Test.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ public void test_async() throws ExecutionException, InterruptedException {
169169
}
170170

171171
@Test
172-
public void list() throws IOException, SlackApiException {
173-
String user = slack.methods().usersList(r -> r.token(botToken))
172+
public void list() throws Exception {
173+
// Using async client to avoid an exception due to rate limited errors
174+
String user = slack.methodsAsync().usersList(r -> r.token(botToken)).get()
174175
.getMembers().get(0).getId();
175176

176177
ReactionsListResponse response = slack.methods().reactionsList(r -> r
@@ -197,8 +198,9 @@ public void list_async() throws ExecutionException, InterruptedException {
197198
}
198199

199200
@Test
200-
public void paginationWithLimitAndCursor() throws IOException, SlackApiException {
201-
String user = slack.methods().usersList(r -> r.token(botToken))
201+
public void paginationWithLimitAndCursor() throws Exception {
202+
// Using async client to avoid an exception due to rate limited errors
203+
String user = slack.methodsAsync().usersList(r -> r.token(botToken)).get()
202204
.getMembers().get(0).getId();
203205

204206
ReactionsListResponse pageOne = slack.methods().reactionsList(r -> r

0 commit comments

Comments
 (0)