use of com.azure.android.communication.common.CommunicationIdentifier 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.CommunicationIdentifier 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());
}
use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method canParseAcsDodUserRawId.
@Test
public void canParseAcsDodUserRawId() {
final String acsUserRawId = "8:dod-acs:" + USER_ID;
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(acsUserRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof CommunicationUserIdentifier);
CommunicationUserIdentifier communicationUserIdentifier = (CommunicationUserIdentifier) communicationIdentifier;
assertEquals(acsUserRawId, communicationUserIdentifier.getId());
}
use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method canParseAcsUserRawId.
@Test
public void canParseAcsUserRawId() {
final String acsUserRawId = "8:acs:" + USER_ID;
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(acsUserRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof CommunicationUserIdentifier);
CommunicationUserIdentifier communicationUserIdentifier = (CommunicationUserIdentifier) communicationIdentifier;
assertEquals(acsUserRawId, communicationUserIdentifier.getId());
}
use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method fallbackToUnknownIdentifierForUnknownRawId.
@Test
public void fallbackToUnknownIdentifierForUnknownRawId() {
final String unknownRawId = "unknown_raw_id";
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(unknownRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof UnknownIdentifier);
UnknownIdentifier unknownIdentifier = (UnknownIdentifier) communicationIdentifier;
assertEquals(unknownRawId, unknownIdentifier.getId());
}
Aggregations