use of com.azure.android.communication.common.CommunicationUserIdentifier in project azure-sdk-for-android by Azure.
the class ChatThreadAsyncClientTest method cannotRemoveParticipantWithResponseWithInvalidUser.
@ParameterizedTest
@MethodSource("com.azure.android.core.test.TestBase#getHttpClients")
public void cannotRemoveParticipantWithResponseWithInvalidUser(HttpClient httpClient) throws ExecutionException, InterruptedException {
setupTest(httpClient);
ExecutionException executionException = assertThrows(ExecutionException.class, () -> {
this.chatThreadClient.removeParticipantWithResponse(new CommunicationUserIdentifier("8:acs:invalidUserId"), null).get();
});
Throwable cause = executionException.getCause();
assertNotNull(cause);
assertTrue(cause instanceof ChatErrorResponseException);
ChatErrorResponseException exception = (ChatErrorResponseException) cause;
assertNotNull(exception.getResponse());
assertEquals(400, exception.getResponse().getStatusCode());
}
use of com.azure.android.communication.common.CommunicationUserIdentifier 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.CommunicationUserIdentifier 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());
}
use of com.azure.android.communication.common.CommunicationUserIdentifier in project azure-sdk-for-android by Azure.
the class CommunicationIdentifierConverterTests method serializeCommunicationUser.
@Test
public void serializeCommunicationUser() {
CommunicationIdentifierModel model = CommunicationIdentifierConverter.convert(new CommunicationUserIdentifier(someId), logger);
assertNotNull(model.getCommunicationUser());
assertEquals(someId, model.getCommunicationUser().getId());
}
use of com.azure.android.communication.common.CommunicationUserIdentifier in project azure-sdk-for-android by Azure.
the class ChatAsyncImplClientTest method setupTest.
private void setupTest(HttpClient httpClient) {
this.client = super.getChatClientBuilder(httpClient).buildClient();
this.firstThreadMember = new CommunicationUserIdentifier(THREAD_MEMBER_1);
this.secondThreadMember = new CommunicationUserIdentifier(THREAD_MEMBER_2);
}
Aggregations