From c9a0e38946f88e984c36cfd9e982ba295a60c693 Mon Sep 17 00:00:00 2001 From: fredrikl Date: Tue, 25 Feb 2020 22:33:50 +0100 Subject: [PATCH 1/3] Add microsoft Teams schema to get team id and channel id. --- .../com/microsoft/bot/schema/Activity.java | 44 +++- .../bot/schema/teams/ChannelInfo.java | 60 ++++++ .../bot/schema/teams/NotificationInfo.java | 37 ++++ .../bot/schema/teams/TeamChannelData.java | 191 ++++++++++++++++++ .../microsoft/bot/schema/teams/TeamInfo.java | 89 ++++++++ .../bot/schema/teams/TenantInfo.java | 38 ++++ .../bot/schema/teams/package-info.java | 8 + 7 files changed, 466 insertions(+), 1 deletion(-) create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java index abcad372c..4603e2e05 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java @@ -3,6 +3,8 @@ package com.microsoft.bot.schema; +import com.microsoft.bot.schema.teams.TeamChannelData; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonFormat; @@ -1504,4 +1506,44 @@ public static String removeMentionTextImmutable(Activity activity, String id) { return text; } -} + + /** + * Check if this actvity is from microsoft teams. + * @return true if the activity is from microsoft teams. + */ + public boolean isTeamsActivity() { + return "msteams".equals(channelId); + } + + /** + * Get unique identifier representing a channel. + * + * @throws JsonProcessingException when channel data can't be parsed to TeamChannelData + * @return Unique identifier representing a channel + */ + public String teamsGetChannelId() throws JsonProcessingException { + TeamChannelData teamsChannelData = getChannelData(TeamChannelData.class); + String teamsChannelId = teamsChannelData.getTeamsChannelId(); + if (teamsChannelId == null && teamsChannelData.getChannel() != null) { + teamsChannelId = teamsChannelData.getChannel().getId(); + } + + return teamsChannelId; + } + + /** + * Get unique identifier representing a team. + * + * @throws JsonProcessingException when channel data can't be parsed to TeamChannelData + * @return Unique identifier representing a team. + */ + public String teamsGetTeamId() throws JsonProcessingException { + TeamChannelData teamsChannelData = getChannelData(TeamChannelData.class); + String teamId = teamsChannelData.getTeamsTeamId(); + if (teamId == null && teamsChannelData.getTeam() != null) { + teamId = teamsChannelData.getTeam().getId(); + } + + return teamId; + } +} \ No newline at end of file diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java new file mode 100644 index 000000000..8b57cbf2c --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java @@ -0,0 +1,60 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +/** + * A channel info object which describes the channel. +*/ +public class ChannelInfo { + @JsonProperty(value = "id") + private String id; + + /** + * name of the channel. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the unique identifier representing a channel. + * @return the unique identifier representing a channel. + */ + public final String getId() { + return id; + } + + /** + * Set unique identifier representing a channel. + * @param withId the unique identifier representing a channel. + */ + public void setId(String withId) { + this.id = withId; + } + + /** + * Get the name of the channel. + * @return name of the channel. + */ + public String getName() { + return name; + } + + /** + * Sets name of the channel. + * @param withName the name of the channel. + */ + public void setName(String withName) { + this.name = withName; + } + + /** + * Initializes a new instance of the ChannelInfo class. + * @param withId identifier representing a channel. + * @param withName Name of the channel. + */ + public ChannelInfo(String withId, String withName) { + this.id = withId; + this.name = withName; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java new file mode 100644 index 000000000..1059498cb --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java @@ -0,0 +1,37 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Specifies if a notification is to be sent for the mentions. + */ +public class NotificationInfo { + /** + * Gets or sets true if notification is to be sent to the user, false. + */ + @JsonProperty(value = "alert") + private Boolean alert; + + /** + * Getter for alert. + * @return return the alter value. + */ + public Boolean getAlert() { + return alert; + } + + /** + * Setter for alert. + * @param withAlert the value to set. + */ + public void setAlert(Boolean withAlert) { + alert = withAlert; + } + + /** + * A new instance of NotificationInfo. + * @param withAlert alert value to set. + */ + public NotificationInfo(Boolean withAlert) { + alert = withAlert; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java new file mode 100644 index 000000000..eb3e4bf2d --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java @@ -0,0 +1,191 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +/** + * Channel data specific to messages received in Microsoft Teams. + */ +public class TeamChannelData { + @JsonProperty(value = "teamsChannelId") + private String teamsChannelId; + + @JsonProperty(value = "teamsTeamId") + private String teamsTeamId; + + @JsonProperty(value = "channel") + private ChannelInfo channel; + + /// Gets or sets type of event. + @JsonProperty(value = "eventType") + private String eventType; + + /// Gets or sets information about the team in which the message was + /// sent + @JsonProperty(value = "team") + private TeamInfo team; + + /// Gets or sets notification settings for the message + @JsonProperty(value = "notification") + private NotificationInfo notification; + + /// Gets or sets information about the tenant in which the message was + /// sent + @JsonProperty(value = "tenant") + private TenantInfo tenant; + + /** + * Get unique identifier representing a channel. + * @return Unique identifier representing a channel. + */ + public String getTeamsChannelId() { + return teamsChannelId; + } + + /** + * Set unique identifier representing a channel. + * @param withTeamsChannelId Unique identifier representing a channel. + */ + public void setTeamsChannelId(String withTeamsChannelId) { + this.teamsChannelId = withTeamsChannelId; + } + + /** + * Get unique identifier representing a team. + * @return Unique identifier representing a team. + */ + public String getTeamsTeamId() { + return teamsTeamId; + } + /** + * Set unique identifier representing a team. + * @param withTeamsTeamId Unique identifier representing a team. + */ + public void setTeamsTeamId(String withTeamsTeamId) { + this.teamsTeamId = withTeamsTeamId; + } + + /** + * Gets information about the channel in which the message was + * sent. + * + * @return information about the channel in which the message was + * sent. + */ + public ChannelInfo getChannel() { + return channel; + } + + /** + * Sets information about the channel in which the message was + * sent. + * + * @param withChannel information about the channel in which the message was + * sent. + */ + public void setChannel(ChannelInfo withChannel) { + this.channel = withChannel; + } + + /** + * Gets type of event. + * + * @return type of event. + */ + public String getEventType() { + return eventType; + } + + /** + * Sets type of event. + * + * @param withEventType type of event. + */ + public void setEventType(String withEventType) { + this.eventType = withEventType; + } + + /** + * Gets information about the team in which the message was + * sent. + * + * @return information about the team in which the message was + * sent. + */ + public TeamInfo getTeam() { + return team; + } + + /** + * Sets information about the team in which the message was + * sent. + * + * @param withTeam information about the team in which the message was + * sent. + */ + public void setTeam(TeamInfo withTeam) { + this.team = withTeam; + } + + /** + * Gets notification settings for the message. + * + * @return notification settings for the message. + */ + public NotificationInfo getNotification() { + return notification; + } + + /** + * Sets notification settings for the message. + * + * @param withNotification settings for the message. + */ + public void setNotification(NotificationInfo withNotification) { + this.notification = withNotification; + } + + /** + * Gets information about the tenant in which the message was. + * @return information about the tenant in which the message was. + */ + public TenantInfo getTenant() { + return tenant; + } + + /** + * Sets information about the tenant in which the message was. + * @param withTenant information about the tenant in which the message was. + */ + public void setTenant(TenantInfo withTenant) { + this.tenant = withTenant; + } + + /** + * A new instance of TeamChannelData. + * @param withTeamsChannelId the channelId in Teams + * @param withTeamsTeamId the teamId in Teams + * @param withChannel information about the channel in which the message was sent. + * @param withEventType type of event. + * @param withTeam information about the team in which the message was + * sent. + * @param withNotification Notification settings for the message. + * @param withTenant Information about the tenant in which the message was. + */ + public TeamChannelData(String withTeamsChannelId, + String withTeamsTeamId, + ChannelInfo withChannel, + String withEventType, + TeamInfo withTeam, + NotificationInfo withNotification, + TenantInfo withTenant) { + this.teamsChannelId = withTeamsChannelId; + this.teamsTeamId = withTeamsTeamId; + this.channel = withChannel; + this.eventType = withEventType; + this.team = withTeam; + this.notification = withNotification; + this.tenant = withTenant; + } + +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java new file mode 100644 index 000000000..415ff0fff --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java @@ -0,0 +1,89 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a team. +*/ +public class TeamInfo { + /** + * Unique identifier representing a team. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of a team. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Azure Active Directory (AAD) Group Id for the team. + * + * We don't see this C#, but Teams + * definitely sends this to the bot. + */ + @JsonProperty(value = "aadGroupId") + private String aadGroupId; + + /** + * Get unique identifier representing a team. + * @return Unique identifier representing a team. + */ + public String getId() { + return id; + } + + /** + * Set unique identifier representing a team. + * @param withId unique identifier representing a team. + */ + public void setId(String withId) { + id = withId; + } + + /** + * Get the name of the team. + * @return get the name of the team. + */ + public String getName() { + return name; + } + + /** + * Set the name of the team. + * @param withName name of the team. + */ + public void setName(String withName) { + name = withName; + } + + /** + * Get Azure Active Directory (AAD) Group Id for the team. + * @return Azure Active Directory (AAD) Group Id for the team. + */ + public String getAadGroupId() { + return aadGroupId; + } + + /** + * Set Azure Active Directory (AAD) Group Id for the team. + * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team + */ + public void setAadGroupId(String withAadGroupId) { + this.aadGroupId = withAadGroupId; + } + + /** + * A new instance of TeamInfo. + * @param withId unique identifier representing a team. + * @param withName Set the name of the team. + * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team + */ + public TeamInfo(String withId, String withName, String withAadGroupId) { + this.id = withId; + this.name = withName; + this.aadGroupId = withAadGroupId; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java new file mode 100644 index 000000000..0b7f201e9 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java @@ -0,0 +1,38 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a tenant. +*/ +public class TenantInfo { + /** + * Unique identifier representing a tenant. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get Unique identifier representing a tenant. + * @return Unique identifier representing a tenant. + */ + public String getId() { + return id; + } + + /** + * Set Unique identifier representing a tenant. + * @param withId Unique identifier representing a tenant. + */ + public void setId(String withId) { + this.id = withId; + } + + /** + * Set Unique identifier representing a tenant. + * @param withId Unique identifier representing a tenant. + */ + public TenantInfo(String withId) { + this.id = withId; + } +} \ No newline at end of file diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java new file mode 100644 index 000000000..86bf40c5c --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the models classes for bot-schema. + */ +package com.microsoft.bot.schema.teams; From 9b5ad39e52e46b3b60bab776a96c13c6c7846262 Mon Sep 17 00:00:00 2001 From: fredrikl Date: Tue, 25 Feb 2020 23:55:55 +0100 Subject: [PATCH 2/3] add default constructor and finish the test --- .../bot/schema/teams/ChannelInfo.java | 6 ++ .../bot/schema/teams/NotificationInfo.java | 6 ++ .../bot/schema/teams/TeamChannelData.java | 6 ++ .../microsoft/bot/schema/teams/TeamInfo.java | 6 ++ .../bot/schema/teams/TenantInfo.java | 8 +- .../microsoft/bot/schema/ActivityTest.java | 73 +++++++++++++++++++ 6 files changed, 104 insertions(+), 1 deletion(-) diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java index 8b57cbf2c..61b463f0c 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java @@ -57,4 +57,10 @@ public ChannelInfo(String withId, String withName) { this.id = withId; this.name = withName; } + + /** + * Initializes a new instance of the ChannelInfo class. + */ + public ChannelInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java index 1059498cb..3b05aefe1 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java @@ -34,4 +34,10 @@ public void setAlert(Boolean withAlert) { public NotificationInfo(Boolean withAlert) { alert = withAlert; } + + /** + * A new instance of NotificationInfo. + */ + public NotificationInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java index eb3e4bf2d..39a75615a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java @@ -188,4 +188,10 @@ public TeamChannelData(String withTeamsChannelId, this.tenant = withTenant; } + /** + * A new instance of TeamChannelData. + */ + public TeamChannelData() { + } + } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java index 415ff0fff..f23d01a19 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java @@ -86,4 +86,10 @@ public TeamInfo(String withId, String withName, String withAadGroupId) { this.name = withName; this.aadGroupId = withAadGroupId; } + + /** + * A new instance of TeamInfo. + */ + public TeamInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java index 0b7f201e9..f985f67dd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java @@ -29,10 +29,16 @@ public void setId(String withId) { } /** - * Set Unique identifier representing a tenant. + * New instance of TenantInfo. * @param withId Unique identifier representing a tenant. */ public TenantInfo(String withId) { this.id = withId; } + + /** + * New instance of TenantInfo. + */ + public TenantInfo() { + } } \ No newline at end of file diff --git a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java index 5487aaa8f..4f9b273f1 100644 --- a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java +++ b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java @@ -3,6 +3,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.microsoft.bot.schema.teams.TeamChannelData; + import org.junit.Assert; import org.junit.Test; @@ -196,4 +198,75 @@ public void DeserializeActivity() throws IOException { Assert.assertNotNull(activity.getValue()); } + private static final String serializedActivityFromTeams = "{" + + " \"channelData\": {" + + " \"teamsChannelId\": \"19:123cb42aa5a0a7e56f83@thread.skype\"," + + " \"teamsTeamId\": \"19:104f2cb42aa5a0a7e56f83@thread.skype\"," + + " \"channel\": {" + + " \"id\": \"19:4104f2cb42aa5a0a7e56f83@thread.skype\"," + + " \"name\": \"General\" " + + " }," + + " \"team\": {" + + " \"id\": \"19:aab4104f2cb42aa5a0a7e56f83@thread.skype\"," + + " \"name\": \"Kahoot\", " + + " \"aadGroupId\": \"0ac65971-e8a0-49a1-8d41-26089125ea30\"" + + " }," + + " \"notification\": {" + + " \"alert\": \"true\"" + + " }," + + " \"eventType\":\"teamMemberAdded\", " + + " \"tenant\": {" + + " \"id\": \"0-b827-4bb0-9df1-e02faba7ac20\"" + + " }" + + " }" + + "}"; + + private static final String serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId = "{" + + " \"channelData\": {" + + " \"channel\": {" + + " \"id\": \"channel_id\"," + + " \"name\": \"channel_name\" " + + " }," + + " \"team\": {" + + " \"id\": \"team_id\"," + + " \"name\": \"team_name\", " + + " \"aadGroupId\": \"aad_groupid\"" + + " }," + + " \"notification\": {" + + " \"alert\": \"true\"" + + " }," + + " \"eventType\":\"teamMemberAdded\", " + + " \"tenant\": {" + + " \"id\": \"tenant_id\"" + + " }" + + " }" + + "}"; + + + + @Test + public void GetInformationForMicrosoftTeams() throws JsonProcessingException, IOException { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.findAndRegisterModules(); + Activity activity = objectMapper.readValue(ActivityTest.serializedActivityFromTeams, Activity.class); + Assert.assertEquals("19:123cb42aa5a0a7e56f83@thread.skype", activity.teamsGetChannelId()); + Assert.assertEquals("19:104f2cb42aa5a0a7e56f83@thread.skype", activity.teamsGetTeamId()); + + activity = objectMapper.readValue( + ActivityTest.serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId, Activity.class); + + Assert.assertEquals("channel_id", activity.teamsGetChannelId()); + Assert.assertEquals("team_id", activity.teamsGetTeamId()); + + TeamChannelData teamsChannelData = activity.getChannelData(TeamChannelData.class); + Assert.assertEquals("channel_id", teamsChannelData.getChannel().getId()); + Assert.assertEquals("channel_name", teamsChannelData.getChannel().getName()); + Assert.assertEquals("team_id", teamsChannelData.getTeam().getId()); + Assert.assertEquals("team_name", teamsChannelData.getTeam().getName()); + Assert.assertEquals("aad_groupid", teamsChannelData.getTeam().getAadGroupId()); + Assert.assertEquals(true, teamsChannelData.getNotification().getAlert()); + Assert.assertEquals("teamMemberAdded", teamsChannelData.getEventType()); + Assert.assertEquals("tenant_id", teamsChannelData.getTenant().getId()); + } + } From 588e37be0b0212eedda8cdb462485ad83f897e93 Mon Sep 17 00:00:00 2001 From: fredrikl Date: Wed, 26 Feb 2020 00:03:03 +0100 Subject: [PATCH 3/3] add test for "isTeamsActivity" too --- .../src/test/java/com/microsoft/bot/schema/ActivityTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java index 4f9b273f1..99f2be722 100644 --- a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java +++ b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java @@ -199,6 +199,7 @@ public void DeserializeActivity() throws IOException { } private static final String serializedActivityFromTeams = "{" + + " \"channelId\": \"msteams\"," + " \"channelData\": {" + " \"teamsChannelId\": \"19:123cb42aa5a0a7e56f83@thread.skype\"," + " \"teamsTeamId\": \"19:104f2cb42aa5a0a7e56f83@thread.skype\"," + @@ -222,6 +223,7 @@ public void DeserializeActivity() throws IOException { "}"; private static final String serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId = "{" + + " \"channelId\": \"msteams\"," + " \"channelData\": {" + " \"channel\": {" + " \"id\": \"channel_id\"," + @@ -251,6 +253,7 @@ public void GetInformationForMicrosoftTeams() throws JsonProcessingException, IO Activity activity = objectMapper.readValue(ActivityTest.serializedActivityFromTeams, Activity.class); Assert.assertEquals("19:123cb42aa5a0a7e56f83@thread.skype", activity.teamsGetChannelId()); Assert.assertEquals("19:104f2cb42aa5a0a7e56f83@thread.skype", activity.teamsGetTeamId()); + Assert.assertEquals(true, activity.isTeamsActivity()); activity = objectMapper.readValue( ActivityTest.serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId, Activity.class);