Skip to content

Commit

Permalink
Merge pull request Azure#204 from RikkiGibson/v2
Browse files Browse the repository at this point in the history
OkHttpClient, RxNettyClient -> OkHttpAdapter, RxNettyAdapter
  • Loading branch information
RikkiGibson authored Aug 30, 2017
2 parents 70c3021 + 8ef9704 commit e22d112
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.microsoft.rest.v2.http.HttpHeader;
import com.microsoft.rest.v2.http.HttpRequest;
import com.microsoft.rest.v2.http.HttpResponse;
import com.microsoft.rest.v2.http.OkHttpClient;
import com.microsoft.rest.v2.http.OkHttpAdapter;
import com.microsoft.rest.v2.http.UrlBuilder;
import rx.Completable;
import rx.Single;
Expand Down Expand Up @@ -133,7 +133,7 @@ public Single<Object> call(String responseBodyString) {
*/
@SuppressWarnings("unchecked")
public static <A> A create(Class<A> swaggerInterface, RestClient restClient) {
final HttpClient httpClient = new OkHttpClient(restClient.httpClient());
final HttpClient httpClient = new OkHttpAdapter(restClient.httpClient());
final SerializerAdapter<?> serializer = restClient.serializerAdapter();
return create(swaggerInterface, httpClient, serializer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
/**
* A HttpClient that is implemented using OkHttp.
*/
public class OkHttpClient extends HttpClient {
public class OkHttpAdapter extends HttpClient {
private final okhttp3.OkHttpClient client;

/**
* Create a new OkHttpClient.
* @param client The inner OkHttpClient implementation.
* Create a new OkHttpAdapter.
* @param client The inner OkHttpAdapter implementation.
*/
public OkHttpClient(okhttp3.OkHttpClient client) {
public OkHttpAdapter(okhttp3.OkHttpClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* A HttpClient that is implemented using RxNetty.
*/
public class RxNettyClient extends HttpClient {
public class RxNettyAdapter extends HttpClient {
private SSLEngine getSSLEngine(String host) {
SSLContext sslCtx;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
import com.microsoft.rest.v2.annotations.QueryParam;
import com.microsoft.rest.v2.http.HttpClient;
import com.microsoft.rest.v2.http.HttpHeaders;
import com.microsoft.rest.v2.http.OkHttpClient;
import org.junit.Test;
import rx.Completable;
import rx.Single;

import java.io.IOException;
import java.io.InputStream;
import java.util.Map;

import static org.junit.Assert.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.microsoft.rest.v2;

import com.microsoft.rest.v2.http.HttpClient;
import com.microsoft.rest.v2.http.OkHttpClient;
import com.microsoft.rest.v2.http.OkHttpAdapter;

public class RestProxyWithOkHttpTests extends RestProxyTests {
@Override
protected HttpClient createHttpClient() {
final okhttp3.OkHttpClient.Builder okHttpClientBuilder = new okhttp3.OkHttpClient.Builder();
final okhttp3.OkHttpClient innerHttpClient = okHttpClientBuilder.build();
return new OkHttpClient(innerHttpClient);
return new OkHttpAdapter(innerHttpClient);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.microsoft.rest.v2;

import com.microsoft.rest.v2.http.HttpClient;
import com.microsoft.rest.v2.http.RxNettyClient;
import com.microsoft.rest.v2.http.RxNettyAdapter;

public class RestProxyWithRxNettyTests extends RestProxyTests {
@Override
protected HttpClient createHttpClient() {
return new RxNettyClient();
return new RxNettyAdapter();
}
}

0 comments on commit e22d112

Please sign in to comment.