Skip to content

Commit

Permalink
Run all the integration tests - 2022-10-05 PT
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Oct 6, 2022
1 parent a87ae51 commit 586f8fe
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 40 deletions.
236 changes: 199 additions & 37 deletions json-logs/samples/api/chat.postMessage.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,46 @@
"blocks": [
{
"type": "",
"block_id": "",
"elements": [
{
"type": "",
"elements": [
{
"type": "",
"text": ""
},
{
"type": "",
"elements": [
{
"type": "",
"range": "",
"text": "",
"style": {
"bold": false,
"italic": false,
"strike": false,
"code": false
},
"channel_id": "",
"value": "",
"timestamp": "",
"url": "",
"team_id": "",
"user_id": "",
"usergroup_id": "",
"name": "",
"skin_tone": 12345,
"unicode": ""
}
],
"style": "",
"indent": 12345,
"offset": 12345,
"border": 12345
}
],
"text": {
"type": "",
"text": "",
Expand Down Expand Up @@ -199,6 +236,166 @@
"initial_users": [
""
],
"indent": 12345,
"offset": 12345,
"border": 12345
},
{
"type": "",
"text": {
"type": "",
"text": "",
"emoji": false
},
"action_id": "",
"url": "",
"value": "",
"style": "",
"confirm": {
"title": {
"type": "",
"text": "",
"emoji": false
},
"text": {
"type": "",
"text": "",
"emoji": false
},
"confirm": {
"type": "",
"text": "",
"emoji": false
},
"deny": {
"type": "",
"text": "",
"emoji": false
},
"style": ""
},
"accessibility_label": "",
"options": [
{
"text": {
"type": "",
"text": "",
"emoji": false
},
"value": "",
"description": {
"type": "",
"text": "",
"emoji": false
},
"url": ""
}
],
"initial_options": [
{
"text": {
"type": "",
"text": "",
"emoji": false
},
"value": "",
"description": {
"type": "",
"text": "",
"emoji": false
},
"url": ""
}
],
"focus_on_load": false,
"initial_option": {
"text": {
"type": "",
"text": "",
"emoji": false
},
"value": "",
"description": {
"type": "",
"text": "",
"emoji": false
},
"url": ""
},
"placeholder": {
"type": "",
"text": "",
"emoji": false
},
"initial_channel": "",
"response_url_enabled": false,
"initial_channels": [
""
],
"max_selected_items": 12345,
"initial_conversation": "",
"default_to_current_conversation": false,
"filter": {
"include": [
""
],
"exclude_external_shared_channels": false,
"exclude_bot_users": false
},
"initial_conversations": [
""
],
"initial_date": "",
"initial_time": "",
"timezone": "",
"min_query_length": 12345,
"image_url": "",
"alt_text": "",
"fallback": "",
"image_width": 12345,
"image_height": 12345,
"image_bytes": 12345,
"option_groups": [
{
"label": {
"type": "",
"text": "",
"emoji": false
},
"options": [
{
"text": {
"type": "",
"text": "",
"emoji": false
},
"value": "",
"description": {
"type": "",
"text": "",
"emoji": false
},
"url": ""
}
]
}
],
"initial_user": "",
"initial_users": [
""
]
},
{
"type": "",
"image_url": "",
"alt_text": "",
"fallback": "",
"image_width": 12345,
"image_height": 12345,
"image_bytes": 12345
},
{
"type": "",
"elements": [
{
"type": "",
Expand Down Expand Up @@ -231,12 +428,12 @@
"border": 12345
}
],
"style": "",
"indent": 12345,
"offset": 12345,
"border": 12345
}
],
"block_id": "",
"call_id": "",
"api_decoration_available": false,
"call": {
Expand Down Expand Up @@ -1135,42 +1332,7 @@
"initial_user": "",
"initial_users": [
""
],
"elements": [
{
"type": "",
"elements": [
{
"type": "",
"range": "",
"text": "",
"style": {
"bold": false,
"italic": false,
"strike": false,
"code": false
},
"channel_id": "",
"value": "",
"timestamp": "",
"url": "",
"team_id": "",
"user_id": "",
"usergroup_id": "",
"name": "",
"skin_tone": 12345,
"unicode": ""
}
],
"style": "",
"indent": 12345,
"offset": 12345,
"border": 12345
}
],
"indent": 12345,
"offset": 12345,
"border": 12345
]
},
{
"type": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public void createLongTextFile() throws IOException, SlackApiException {
}

@Test
public void createLongTextFile_v2() throws IOException, SlackApiException {
public void createLongTextFile_v2() throws Exception {
File file = new File("src/test/resources/sample_long.txt");
com.slack.api.model.File fileObj;
{
Expand All @@ -295,15 +295,18 @@ public void createLongTextFile_v2() throws IOException, SlackApiException {
.title("file title"));
assertThat(response.getError(), is(nullValue()));
assertThat(response.isOk(), is(true));
fileObj = response.getFile();

Thread.sleep(3000L);

fileObj = slack.methods(botToken).filesInfo(r -> r.file(response.getFile().getId())).getFile();

assertThat(fileObj.getTitle(), is("file title"));
assertThat(fileObj.getName(), is("sample.txt"));
assertThat(fileObj.getMimetype(), is(anyOf(is(""), is("text/plain")))); // only "text/plain" for legacy
assertThat(fileObj.getFiletype(), is(anyOf(is(""), is("text")))); // only "text" for legacy
assertThat(fileObj.getPrettyType(), is(anyOf(is(""), is("Plain Text")))); // only "Plain Text" for legacy
assertThat(fileObj.getSize(), is(19648));
// assertThat(fileObj.isEditable(), is(true));
assertThat(fileObj.isEditable(), is(true));

assertThat(fileObj.isPreviewTruncated(), is(true));
assertThat(fileObj.getLines(), is(182));
Expand Down

0 comments on commit 586f8fe

Please sign in to comment.