use of com.azure.android.communication.chat.implementation.models.CreateChatThreadOptions in project azure-sdk-for-android by Azure.
the class ChatAsyncImplClientTest method canCreateNewThreadWithoutSettingRepeatabilityID.
@ParameterizedTest
@MethodSource("com.azure.android.core.test.TestBase#getHttpClients")
public void canCreateNewThreadWithoutSettingRepeatabilityID(HttpClient httpClient) throws ExecutionException, InterruptedException {
setupTest(httpClient);
UUID uuid = UUID.randomUUID();
final CreateChatThreadOptions threadRequest = createThreadOptions(firstThreadMember.getId(), secondThreadMember.getId());
CompletableFuture<Response<CreateChatThreadResult>> completableFuture1 = this.client.getChatClient().createChatThreadWithResponseAsync(threadRequest, null);
assertNotNull(completableFuture1);
Response<CreateChatThreadResult> response1 = completableFuture1.get();
assertNotNull(response1);
CreateChatThreadResult result1 = response1.getValue();
assertNotNull(result1);
assertNotNull(result1.getChatThread());
assertNotNull(result1.getChatThread().getId());
String threadId1 = response1.getValue().getChatThread().getId();
CompletableFuture<Response<CreateChatThreadResult>> completableFuture2 = this.client.getChatClient().createChatThreadWithResponseAsync(threadRequest, null);
assertNotNull(completableFuture2);
Response<CreateChatThreadResult> response2 = completableFuture2.get();
assertNotNull(response2);
CreateChatThreadResult result2 = response2.getValue();
assertNotNull(result2);
assertNotNull(result2.getChatThread());
assertNotNull(result2.getChatThread().getId());
assertNotEquals(threadId1, result2.getChatThread().getId());
}
Aggregations