Search in sources :

Example 6 with MicrosoftTeamsUserIdentifier

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());
}
Also used : MicrosoftTeamsUserIdentifier(com.azure.android.communication.common.MicrosoftTeamsUserIdentifier) CommunicationIdentifier(com.azure.android.communication.common.CommunicationIdentifier) Test(org.junit.jupiter.api.Test)

Example 7 with MicrosoftTeamsUserIdentifier

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());
}
Also used : MicrosoftTeamsUserIdentifier(com.azure.android.communication.common.MicrosoftTeamsUserIdentifier) CommunicationIdentifier(com.azure.android.communication.common.CommunicationIdentifier) Test(org.junit.jupiter.api.Test)

Aggregations

MicrosoftTeamsUserIdentifier (com.azure.android.communication.common.MicrosoftTeamsUserIdentifier)7 CommunicationIdentifier (com.azure.android.communication.common.CommunicationIdentifier)4 Test (org.junit.jupiter.api.Test)4 CommunicationIdentifierModel (com.azure.android.communication.chat.implementation.models.CommunicationIdentifierModel)2 MicrosoftTeamsUserIdentifierModel (com.azure.android.communication.chat.implementation.models.MicrosoftTeamsUserIdentifierModel)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 ValueSource (org.junit.jupiter.params.provider.ValueSource)2 CommunicationCloudEnvironmentModel (com.azure.android.communication.chat.implementation.models.CommunicationCloudEnvironmentModel)1 PhoneNumberIdentifierModel (com.azure.android.communication.chat.implementation.models.PhoneNumberIdentifierModel)1 CommunicationUserIdentifier (com.azure.android.communication.common.CommunicationUserIdentifier)1 PhoneNumberIdentifier (com.azure.android.communication.common.PhoneNumberIdentifier)1 UnknownIdentifier (com.azure.android.communication.common.UnknownIdentifier)1