Skip to content

Commit

Permalink
Run all the integration tests - 2024-11-07 PT
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Nov 8, 2024
1 parent e359171 commit 73c84ff
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 27 deletions.
38 changes: 37 additions & 1 deletion json-logs/samples/events/ChannelCreatedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,43 @@
"creator": "",
"is_shared": false,
"is_org_shared": false,
"context_team_id": ""
"context_team_id": "",
"is_group": false,
"is_im": false,
"is_mpim": false,
"is_private": false,
"is_archived": false,
"is_general": false,
"unlinked": 12345,
"is_pending_ext_shared": false,
"pending_shared": [
""
],
"updated": 12345,
"is_moved": 12345,
"is_ext_shared": false,
"shared_team_ids": [
""
],
"internal_team_ids": [
""
],
"pending_connected_team_ids": [
""
],
"topic": {
"value": "",
"creator": "",
"last_set": 12345
},
"purpose": {
"value": "",
"creator": "",
"last_set": 12345
},
"previous_names": [
""
]
},
"event_ts": "0000000000.000000"
},
Expand Down
2 changes: 0 additions & 2 deletions json-logs/samples/events/FilePublicPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"file_id": "",
Expand Down
4 changes: 1 addition & 3 deletions json-logs/samples/events/FileSharedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "file_shared",
"file_id": "",
"user_id": "",
"file": {
"id": ""
},
"channel_id": "",
"type": "file_shared",
"event_ts": "0000000000.000000"
},
"type": "event_callback",
Expand Down
2 changes: 0 additions & 2 deletions json-logs/samples/events/FileUnsharedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"file_id": "",
Expand Down
2 changes: 0 additions & 2 deletions json-logs/samples/events/GroupArchivePayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "group_archive",
Expand Down
2 changes: 0 additions & 2 deletions json-logs/samples/events/GroupRenamePayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "group_rename",
Expand Down
5 changes: 2 additions & 3 deletions json-logs/samples/events/MemberJoinedChannelPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "member_joined_channel",
Expand All @@ -12,7 +10,8 @@
"channel_type": "",
"team": "",
"event_ts": "0000000000.000000",
"inviter": ""
"inviter": "",
"enterprise": ""
},
"type": "event_callback",
"event_id": "",
Expand Down
2 changes: 0 additions & 2 deletions json-logs/samples/events/MemberLeftChannelPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "member_left_channel",
Expand Down
4 changes: 1 addition & 3 deletions json-logs/samples/events/ReactionAddedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "reaction_added",
"user": "",
"reaction": "",
"item": {
"type": "message",
"channel": "",
"ts": "0000000000.000000"
},
"reaction": "",
"item_user": "",
"event_ts": "0000000000.000000"
},
Expand Down
4 changes: 1 addition & 3 deletions json-logs/samples/events/ReactionRemovedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
"token": "",
"team_id": "",
"enterprise_id": "",
"context_team_id": "",
"context_enterprise_id": "",
"api_app_id": "",
"event": {
"type": "reaction_removed",
"user": "",
"reaction": "",
"item": {
"type": "message",
"channel": "",
"ts": "0000000000.000000"
},
"reaction": "",
"item_user": "",
"event_ts": "0000000000.000000"
},
Expand Down
3 changes: 2 additions & 1 deletion json-logs/samples/events/SubteamCreatedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
""
],
"user_count": 12345,
"channel_count": 12345
"channel_count": 12345,
"is_section": false
},
"event_ts": "0000000000.000000"
},
Expand Down
2 changes: 1 addition & 1 deletion json-logs/samples/events/SubteamMembersChangedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"event": {
"type": "subteam_members_changed",
"subteam_id": "",
"team_id": "",
"date_previous_update": 12345,
"date_update": 12345,
"added_users": [
Expand All @@ -16,7 +17,6 @@
""
],
"removed_users_count": 12345,
"team_id": "",
"event_ts": "0000000000.000000"
},
"type": "event_callback",
Expand Down
4 changes: 3 additions & 1 deletion json-logs/samples/events/SubteamUpdatedPayload.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
""
],
"user_count": 12345,
"channel_count": 12345
"channel_count": 12345,
"deleted_by": "",
"is_section": false
},
"event_ts": "0000000000.000000"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package com.slack.api.model.event;

import com.google.gson.annotations.SerializedName;
import com.slack.api.model.Latest;
import com.slack.api.model.Purpose;
import com.slack.api.model.Topic;
import lombok.Data;

import java.util.List;

/**
* The channel_created event is sent to all connections for a workspace when a new channel is created.
* Clients can use this to update their local cache of non-joined channels.
Expand All @@ -28,5 +34,58 @@ public static class Channel {
private Integer created;
private String creator;
private String contextTeamId;
private String enterpriseId;

@SerializedName("is_read_only")
private boolean readOnly;
@SerializedName("is_thread_only")
private boolean threadOnly;
@SerializedName("is_archived")
private boolean archived;
@SerializedName("is_member")
private boolean member;
@SerializedName("is_general")
private boolean general;
@SerializedName("is_group")
private boolean group;
@SerializedName("is_im")
private boolean im;
@SerializedName("is_private")
private boolean privateChannel;
@SerializedName("is_mpim")
private boolean mpim;
@SerializedName("is_file")
private boolean file;
@SerializedName("is_global_shared")
private boolean globalShared;
@SerializedName("is_org_default")
private boolean orgDefault;
@SerializedName("is_org_mandatory")
private boolean orgMandatory;
@SerializedName("is_moved")
private Integer isMoved;

@SerializedName("is_ext_shared") // search result
private boolean extShared;
@SerializedName("is_pending_ext_shared") // search result
private boolean pendingExtShared;
private List<String> pendingShared; // search result

private String lastRead;
private Latest latest;
private Integer unreadCount;
private Integer unreadCountDisplay;
private Integer unlinked;
private List<String> members;
private Topic topic;
private Purpose purpose;
private String user;
private List<String> previousNames;
private Integer numMembers;
private Double priority;
private Integer updated;
private List<String> sharedTeamIds;
private List<String> internalTeamIds;
private List<String> pendingConnectedTeamIds;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class MemberJoinedChannelEvent implements Event {
private String user;
private String channel;
private String channelType;
private String enterprise;
private String team;
private String inviter;
private String eventTs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class MemberLeftChannelEvent implements Event {
private String user;
private String channel;
private String channelType;
private String enterprise;
private String team;
private String eventTs;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static class Subteam {
private Integer userCount;
private Integer channelCount;
private List<String> users;
private boolean isSection;
}

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static class Subteam {
private List<String> users;
private Integer userCount;
private Integer channelCount;
private boolean isSection;
}

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void serialize() {
ChannelCreatedEvent event = new ChannelCreatedEvent();
event.setChannel(new ChannelCreatedEvent.Channel());
String generatedJson = gson.toJson(event);
String expectedJson = "{\"type\":\"channel_created\",\"channel\":{\"is_channel\":false,\"is_shared\":false,\"is_org_shared\":false}}";
String expectedJson = "{\"type\":\"channel_created\",\"channel\":{\"is_channel\":false,\"is_shared\":false,\"is_org_shared\":false,\"is_read_only\":false,\"is_thread_only\":false,\"is_archived\":false,\"is_member\":false,\"is_general\":false,\"is_group\":false,\"is_im\":false,\"is_private\":false,\"is_mpim\":false,\"is_file\":false,\"is_global_shared\":false,\"is_org_default\":false,\"is_org_mandatory\":false,\"is_ext_shared\":false,\"is_pending_ext_shared\":false}}";
assertThat(generatedJson, is(expectedJson));
}

Expand Down

0 comments on commit 73c84ff

Please sign in to comment.