use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class CommunicationIdentifierConverterTests method deserializeCommunicationUser.
@Test
public void deserializeCommunicationUser() {
CommunicationIdentifier identifier = CommunicationIdentifierConverter.convert(new CommunicationIdentifierModel().setCommunicationUser(new CommunicationUserIdentifierModel().setId(someId)), logger);
assertEquals(identifier.getClass(), CommunicationUserIdentifier.class);
assertEquals(someId, ((CommunicationUserIdentifier) identifier).getId());
}
use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class CommunicationIdentifierConverterTests method deserializePhoneNumber.
@Test
public void deserializePhoneNumber() {
CommunicationIdentifier identifier = CommunicationIdentifierConverter.convert(new CommunicationIdentifierModel().setRawId(rawId).setPhoneNumber(new PhoneNumberIdentifierModel().setValue(testPhoneNumber)), logger);
assertEquals(PhoneNumberIdentifier.class, identifier.getClass());
assertEquals(testPhoneNumber, ((PhoneNumberIdentifier) identifier).getPhoneNumber());
assertEquals(rawId, ((PhoneNumberIdentifier) identifier).getRawId());
}
use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method canParseTeamsPublicUserRawId.
@Test
public void canParseTeamsPublicUserRawId() {
final String teamsPublicUserRawId = "8:orgid:" + USER_ID;
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(teamsPublicUserRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof MicrosoftTeamsUserIdentifier);
MicrosoftTeamsUserIdentifier microsoftTeamsUserIdentifier = (MicrosoftTeamsUserIdentifier) communicationIdentifier;
assertEquals(CommunicationCloudEnvironment.PUBLIC, microsoftTeamsUserIdentifier.getCloudEnvironment());
assertEquals(false, microsoftTeamsUserIdentifier.isAnonymous());
assertEquals(USER_ID, microsoftTeamsUserIdentifier.getUserId());
assertEquals(teamsPublicUserRawId, microsoftTeamsUserIdentifier.getRawId());
}
use of com.azure.android.communication.common.CommunicationIdentifier in project azure-sdk-for-android by Azure.
the class NotificationUtilsTest method canParseAcsGcchUserRawId.
@Test
public void canParseAcsGcchUserRawId() {
final String acsUserRawId = "8:gcch-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 canParseSpoolUserRawId.
@Test
public void canParseSpoolUserRawId() {
final String spoolUserRawId = "8:spool:" + USER_ID;
CommunicationIdentifier communicationIdentifier = NotificationUtils.getCommunicationIdentifier(spoolUserRawId);
assertNotNull(communicationIdentifier);
assertTrue(communicationIdentifier instanceof CommunicationUserIdentifier);
CommunicationUserIdentifier communicationUserIdentifier = (CommunicationUserIdentifier) communicationIdentifier;
assertEquals(spoolUserRawId, communicationUserIdentifier.getId());
}
Aggregations