use of com.azure.android.communication.common.MicrosoftTeamsUserIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method canParseTeamsDodUserRawId.
@Test
public void canParseTeamsDodUserRawId() {
final String teamsDodUserRawId = "8:dod:" + USER_ID;
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(teamsDodUserRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof MicrosoftTeamsUserIdentifier);
MicrosoftTeamsUserIdentifier microsoftTeamsUserIdentifier = (MicrosoftTeamsUserIdentifier) communicationIdentifier;
assertEquals(CommunicationCloudEnvironment.DOD, microsoftTeamsUserIdentifier.getCloudEnvironment());
assertFalse(microsoftTeamsUserIdentifier.isAnonymous());
assertEquals(USER_ID, microsoftTeamsUserIdentifier.getUserId());
assertEquals(teamsDodUserRawId, microsoftTeamsUserIdentifier.getRawId());
}
use of com.azure.android.communication.common.MicrosoftTeamsUserIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method canParseTeamsGcchUserRawId.
@Test
public void canParseTeamsGcchUserRawId() {
final String teamsGcchUserRawId = "8:gcch:" + USER_ID;
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(teamsGcchUserRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof MicrosoftTeamsUserIdentifier);
MicrosoftTeamsUserIdentifier microsoftTeamsUserIdentifier = (MicrosoftTeamsUserIdentifier) communicationIdentifier;
assertEquals(CommunicationCloudEnvironment.GCCH, microsoftTeamsUserIdentifier.getCloudEnvironment());
assertFalse(microsoftTeamsUserIdentifier.isAnonymous());
assertEquals(USER_ID, microsoftTeamsUserIdentifier.getUserId());
assertEquals(teamsGcchUserRawId, microsoftTeamsUserIdentifier.getRawId());
}
Aggregations