File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
main/java/com/hubspot/slack/client/models/events
java/com/hubspot/slack/client/models/events/json Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1515public interface SlackEventSkeletonIF extends SlackEvent {
1616 @ JsonProperty ("channel" )
1717 Optional <String > getChannelMaybe ();
18+
19+ // Many event types deserialized as skeletons do not have a ts, so we manually set it as null.
20+ @ Override
21+ default String getTs () {
22+ return null ;
23+ }
1824}
Original file line number Diff line number Diff line change @@ -275,6 +275,13 @@ public void itCanDeserLinkSharedEvent() throws IOException {
275275 .isEqualTo (event );
276276 }
277277
278+ @ Test
279+ public void itCanDeserReactionAddedEvent () throws IOException {
280+ SlackEvent event = fetchAndDeserializeSlackEvent ("reaction_added.json" );
281+ assertThat (event .getType ()).isEqualTo (SlackEventType .REACTION_ADDED );
282+ assertThat (event .getTs ()).isNull ();
283+ }
284+
278285 @ Test
279286 public void itCanDeserBotMessageEventCallbacks () throws IOException {
280287 SlackEvent event = fetchAndDeserializeSlackEvent ("bot_message_event_callback.json" );
Original file line number Diff line number Diff line change 1+ {
2+ "token" : " redacted" ,
3+ "team_id" : " T024G0P55" ,
4+ "api_app_id" : " ALZH69H5Z" ,
5+ "event" : {
6+ "type" : " reaction_added" ,
7+ "user" : " U0374K33CR2" ,
8+ "reaction" : " +1::skin-tone-4" ,
9+ "item" : {
10+ "type" : " message" ,
11+ "channel" : " C0AFGUN15AL" ,
12+ "ts" : " 1771357246.016889"
13+ },
14+ "item_user" : " U03TL2T7VNC" ,
15+ "event_ts" : " 1771358418.002600"
16+ },
17+ "type" : " event_callback" ,
18+ "event_id" : " Ev0AFC3DRA3V" ,
19+ "event_time" : 1771358418 ,
20+ "authed_users" : [
21+ " UMB1NLKNC"
22+ ]
23+ }
You can’t perform that action at this time.
0 commit comments