use of com.azure.android.communication.chat.models.ChatParticipant in project azure-sdk-for-android by Azure.
the class ChatThreadAsyncClientTest method cannotAddParticipantsWithResponseWithInvalidUser.
@ParameterizedTest
@MethodSource("com.azure.android.core.test.TestBase#getHttpClients")
public void cannotAddParticipantsWithResponseWithInvalidUser(HttpClient httpClient) throws InterruptedException, ExecutionException {
setupTest(httpClient);
Iterable<ChatParticipant> participants = addParticipants("8:acs:invalidUserId", this.secondThreadParticipant.getId());
ExecutionException executionException = assertThrows(ExecutionException.class, () -> {
this.chatThreadClient.addParticipantsWithResponse(participants, null).get();
});
Throwable cause = executionException.getCause();
assertNotNull(cause);
assertTrue(cause instanceof ChatErrorResponseException);
ChatErrorResponseException exception = (ChatErrorResponseException) cause;
assertNotNull(exception.getResponse());
assertEquals(400, exception.getResponse().getStatusCode());
}
Aggregations