Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions json-logs/samples/api/files.completeUploadExternal.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@
"latest_reply": "0000000000.000000",
"source": "",
"is_silent_share": false
},
{
"reply_users": [
""
],
"reply_users_count": 12345,
"reply_count": 12345,
"ts": "0000000000.000000",
"channel_name": "",
"team_id": "T00000000",
"share_user_id": "U00000000",
"source": "",
"is_silent_share": false
}
],
"C00000001": [
Expand All @@ -80,19 +67,6 @@
"latest_reply": "0000000000.000000",
"source": "",
"is_silent_share": false
},
{
"reply_users": [
""
],
"reply_users_count": 12345,
"reply_count": 12345,
"ts": "0000000000.000000",
"channel_name": "",
"team_id": "T00000000",
"share_user_id": "U00000000",
"source": "",
"is_silent_share": false
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion json-logs/samples/api/oauth.v2.exchange.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"response_metadata": {
"messages": [
""
]
],
"warnings": []
}
}
3 changes: 3 additions & 0 deletions json-logs/samples/scim/v1/Users.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
"display": ""
}
]
},
"urn:scim:schemas:extension:slack:profile:1.0": {
"startDate": ""
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ private Schemas() {
public static final String SCHEMA_CORE = "urn:scim:schemas:core:1.0";
public static final String SCHEMA_EXTENSION_ENTERPRISE = "urn:scim:schemas:extension:enterprise:1.0";
public static final String SCHEMA_EXTENSION_SLACK_GUEST = "urn:scim:schemas:extension:slack:guest:1.0";

public static final String SCHEMA_EXTENSION_SLACK_PROFILE = "urn:scim:schemas:extension:slack:profile:1.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class User {
private List<String> schemas = Arrays.asList(
Schemas.SCHEMA_CORE,
Schemas.SCHEMA_EXTENSION_ENTERPRISE,
Schemas.SCHEMA_EXTENSION_SLACK_GUEST
Schemas.SCHEMA_EXTENSION_SLACK_GUEST,
Schemas.SCHEMA_EXTENSION_SLACK_PROFILE
);

private String id;
Expand Down Expand Up @@ -46,6 +47,8 @@ public class User {
private Extension extension;
@SerializedName(Schemas.SCHEMA_EXTENSION_SLACK_GUEST)
private SlackGuest slackGuest;
@SerializedName(Schemas.SCHEMA_EXTENSION_SLACK_PROFILE)
private SlackProfile slackProfile;

private List<Group> groups;

Expand Down Expand Up @@ -182,4 +185,15 @@ public static class Channel {
}
}

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SlackProfile {
/**
* Identifies date and time the user started within the organization. Used to create and display profile Celebrations.
* The accepted format is ISO 8601. (e.g., "2020-10-31T23:59:59Z")
*/
private String startDate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ public void extensions() {
.type("multi")
.expiration("2020-11-30T23:59:59Z")
.build());
user.setSlackProfile(User.SlackProfile.builder()
.startDate("2020-10-31T23:59:59Z")
.build());

assertNotNull(user);
assertNotNull(user.getExtension().getDivision());
assertNotNull(user.getSlackGuest().getType());
assertNotNull(user.getSlackProfile().getStartDate());

String json = GsonFactory.createCamelCase(SlackConfig.DEFAULT).toJson(user);
String expectedJson = "{\"schemas\":[\"urn:scim:schemas:core:1.0\",\"urn:scim:schemas:extension:enterprise:1.0\",\"urn:scim:schemas:extension:slack:guest:1.0\"],\"id\":\"W1234567890\",\"urn:scim:schemas:extension:enterprise:1.0\":{\"employeeNumber\":\"123-456\",\"organization\":\"PDE\",\"division\":\"Product\",\"department\":\"Product\"},\"urn:scim:schemas:extension:slack:guest:1.0\":{\"type\":\"multi\",\"expiration\":\"2020-11-30T23:59:59Z\"}}";
String expectedJson = "{\"schemas\":[\"urn:scim:schemas:core:1.0\",\"urn:scim:schemas:extension:enterprise:1.0\",\"urn:scim:schemas:extension:slack:guest:1.0\",\"urn:scim:schemas:extension:slack:profile:1.0\"],\"id\":\"W1234567890\",\"urn:scim:schemas:extension:enterprise:1.0\":{\"employeeNumber\":\"123-456\",\"organization\":\"PDE\",\"division\":\"Product\",\"department\":\"Product\"},\"urn:scim:schemas:extension:slack:guest:1.0\":{\"type\":\"multi\",\"expiration\":\"2020-11-30T23:59:59Z\"},\"urn:scim:schemas:extension:slack:profile:1.0\":{\"startDate\":\"2020-10-31T23:59:59Z\"}}";
assertEquals(expectedJson, json);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import lombok.extern.slf4j.Slf4j;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import java.io.IOException;
Expand Down Expand Up @@ -1215,6 +1216,7 @@ public void post_messages_timepicker() throws Exception {
}

// https://github.com/slackapi/java-slack-sdk/issues/647
@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void share_message_with_files_issue_647() throws Exception {
loadRandomChannelId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void loadRandomChannelId() throws IOException, SlackApiException {
void loadGeneralChannelId() throws IOException, SlackApiException {
if (generalChannelId == null) {
ConversationsListResponse channelsListResponse =
slack.methods().conversationsList(r -> r.token(botToken).excludeArchived(true).limit(100));
slack.methods().conversationsList(r -> r.token(botToken).excludeArchived(true).limit(200));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷️ note: Perhaps we revert this? But I changed it because I changed the #general channel of a test workspace I use.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is in a test we can change it in the future if we ever need to, so I think we can leave it in 💯

assertThat(channelsListResponse.getError(), is(nullValue()));
for (Conversation channel : channelsListResponse.getChannels()) {
if (channel.getName().equals("general")) {
Expand Down Expand Up @@ -136,6 +136,7 @@ public void describe_ShowFilesHiddenByLimit() throws IOException, SlackApiExcept
}
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📠 note: Today is the day files.upload stop working! I hope we can revisit skipped tests to check for equivalent coverage with filesUploadV2 before removing these tests altogether?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point 💯 I think this should be a teak for when we remove files.upload

@Test
public void createTextFileAndComments() throws IOException, SlackApiException {
File file = new File("src/test/resources/sample.txt");
Expand Down Expand Up @@ -227,6 +228,7 @@ public void createTextFileAndComments() throws IOException, SlackApiException {
}
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void createLongTextFile() throws IOException, SlackApiException {
File file = new File("src/test/resources/sample_long.txt");
Expand Down Expand Up @@ -430,6 +432,7 @@ public void createLongTextFile_v2_full_args() throws Exception {
}
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void createImageFileAndComments() throws IOException, SlackApiException {
File file = new File("src/test/resources/seratch.jpg");
Expand Down Expand Up @@ -529,6 +532,7 @@ public void createImageFileAndComments() throws IOException, SlackApiException {
}
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void createFileForAThread() throws IOException, SlackApiException {
TestChannelGenerator channelGenerator = new TestChannelGenerator(testConfig, userToken);
Expand Down Expand Up @@ -629,6 +633,7 @@ public void createFileForAThread_v2() throws IOException, SlackApiException {
}
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void issue523_text() throws IOException, SlackApiException {
MethodsClient slackMethods = slack.methods(userToken);
Expand All @@ -638,6 +643,7 @@ public void issue523_text() throws IOException, SlackApiException {
assertThat(response.getError(), is(nullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void issue523_image() throws IOException, SlackApiException {
MethodsClient slackMethods = slack.methods(userToken);
Expand All @@ -647,6 +653,7 @@ public void issue523_image() throws IOException, SlackApiException {
assertThat(response.getError(), is(nullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void issue523_text_no_filename() throws IOException, SlackApiException {
MethodsClient slackMethods = slack.methods(userToken);
Expand All @@ -667,6 +674,7 @@ public void issue523_text_no_filename_v2() throws IOException, SlackApiException
assertThat(response.getError(), is(nullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void issue523_image_no_filename() throws IOException, SlackApiException {
MethodsClient slackMethods = slack.methods(userToken);
Expand All @@ -677,6 +685,7 @@ public void issue523_image_no_filename() throws IOException, SlackApiException {
assertThat(response.getError(), is(nullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void uploadAndPostMessage() throws IOException, SlackApiException, InterruptedException {
MethodsClient slackMethods = slack.methods(botToken);
Expand Down Expand Up @@ -763,6 +772,7 @@ public void uploadAndPostMessage() throws IOException, SlackApiException, Interr
assertThat(uploadAndSharedInTwoTypesOfChannels.getFile().getShares().getPrivateChannels(), is(notNullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void uploadInThreads() throws Exception {
MethodsClient slackMethods = slack.methods(userToken);
Expand Down Expand Up @@ -851,6 +861,7 @@ public void uploadInThreads_v2() throws Exception {
assertThat(replies.getMessages().get(1).getFile(), is(nullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void issue824_gif_files() throws IOException, SlackApiException {
loadRandomChannel();
Expand Down Expand Up @@ -908,6 +919,7 @@ public void issue1314_non_image_files_with_v2() throws IOException, SlackApiExce
assertThat(upload2.getError(), is(nullValue()));
}

@Ignore // "method_deprecated" 2025-11-12 https://docs.slack.dev/changelog/2025/03/17/files-upload-extension/
@Test
public void fileLinks() throws Exception {
loadRandomChannelId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static class TranscriptionPreview {
}

private Integer originalAttachmentCount;
private Integer inlineAttachmentCount;

@SerializedName("is_external")
private boolean external;
Expand Down Expand Up @@ -415,4 +416,4 @@ public static class Favorite {
private List<LayoutBlock> blocks;
// ---------------------------------------

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public class ListMetadata {
private boolean trial;
private ListCreationSource creationSource;
private List<ListColumn> schema;
private List<ListColumn> subtaskSchema;
private List<ListView> views;
private List<String> integrations;
private List<LayoutBlock> descriptionBlocks;
private String defaultView;
private boolean todoMode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ public class ListViewColumn {
private String id;
private String position;
private Integer width;
private boolean shouldWrapText;
}