use of com.azure.android.communication.chat.models.ChatThreadProperties in project azure-sdk-for-android by Azure.
the class ChatThreadAsyncClientTest method getNotFoundOnNonExistingChatThread.
@ParameterizedTest
@MethodSource("com.azure.android.core.test.TestBase#getHttpClients")
public void getNotFoundOnNonExistingChatThread(HttpClient httpClient) throws ExecutionException, InterruptedException {
setupTest(httpClient);
ExecutionException executionException = assertThrows(ExecutionException.class, () -> {
CompletableFuture<ChatThreadProperties> completableFuture = client.getChatThreadClient("19:00000000000000000000000000000000@thread.v2").getProperties();
completableFuture.get();
});
Throwable cause = executionException.getCause();
assertNotNull(cause);
assertTrue(cause instanceof ChatErrorResponseException);
ChatErrorResponseException exception = (ChatErrorResponseException) cause;
assertNotNull(exception.getResponse());
assertEquals(404, exception.getResponse().getStatusCode());
}
Aggregations