use of com.azure.android.communication.chat.models.UpdateChatMessageOptions in project azure-sdk-for-android by Azure.
the class ChatThreadAsyncClientTest method cannotUpdateMessageWithInvalidId.
@ParameterizedTest
@MethodSource("com.azure.android.core.test.TestBase#getHttpClients")
public void cannotUpdateMessageWithInvalidId(HttpClient httpClient) throws ExecutionException, InterruptedException {
setupTest(httpClient);
UpdateChatMessageOptions updateMessageRequest = super.updateMessageOptions();
ExecutionException executionException = assertThrows(ExecutionException.class, () -> {
this.chatThreadClient.updateMessage("invalid_chat_message_id", updateMessageRequest).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.chat.models.UpdateChatMessageOptions in project azure-sdk-for-android by Azure.
the class ChatThreadAsyncClientTest method cannotUpdateMessageWithResponseWithInvalidId.
@ParameterizedTest
@MethodSource("com.azure.android.core.test.TestBase#getHttpClients")
public void cannotUpdateMessageWithResponseWithInvalidId(HttpClient httpClient) throws ExecutionException, InterruptedException {
setupTest(httpClient);
UpdateChatMessageOptions updateMessageRequest = super.updateMessageOptions();
ExecutionException executionException = assertThrows(ExecutionException.class, () -> {
this.chatThreadClient.updateMessageWithResponse("invalid_chat_message_id", updateMessageRequest, 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