Search in sources :

Example 1 with NoOpHttpClient

use of com.azure.android.core.test.http.NoOpHttpClient in project azure-sdk-for-android by Azure.

the class ChatThreadAsyncClientTest method setupMockTest.

private void setupMockTest() {
    final NoOpHttpClient httpClient = new NoOpHttpClient() {

        @Override
        public void send(HttpRequest httpRequest, CancellationToken cancellationToken, HttpCallback httpCallback) {
            httpCallback.onSuccess(ChatResponseMocker.createReadReceiptsResponse(httpRequest));
        }
    };
    this.client = getChatClientBuilder(httpClient).buildAsyncClient();
    String mockThreadId = "19:4b72178530934b7790135dd9359205e0@thread.v2";
    this.chatThreadClient = client.getChatThreadClient(mockThreadId);
    this.threadId = chatThreadClient.getChatThreadId();
}
Also used : HttpRequest(com.azure.android.core.http.HttpRequest) NoOpHttpClient(com.azure.android.core.test.http.NoOpHttpClient) CancellationToken(com.azure.android.core.util.CancellationToken) HttpCallback(com.azure.android.core.http.HttpCallback)

Aggregations

HttpCallback (com.azure.android.core.http.HttpCallback)1 HttpRequest (com.azure.android.core.http.HttpRequest)1 NoOpHttpClient (com.azure.android.core.test.http.NoOpHttpClient)1 CancellationToken (com.azure.android.core.util.CancellationToken)1