Removed redundant initialization of client
This commit is contained in:
parent
3c050f7053
commit
ee95f0cbde
|
@ -49,8 +49,6 @@ public class OkHttpPostingLiveTest {
|
||||||
public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException {
|
public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException {
|
||||||
final String postBody = "test post";
|
final String postBody = "test post";
|
||||||
|
|
||||||
client = new OkHttpClient();
|
|
||||||
|
|
||||||
final Request request = new Request.Builder()
|
final Request request = new Request.Builder()
|
||||||
.url(URL_SECURED_BY_BASIC_AUTHENTICATION)
|
.url(URL_SECURED_BY_BASIC_AUTHENTICATION)
|
||||||
.addHeader("Authorization", Credentials.basic("test", "test"))
|
.addHeader("Authorization", Credentials.basic("test", "test"))
|
||||||
|
@ -67,8 +65,6 @@ public class OkHttpPostingLiveTest {
|
||||||
public void whenPostJson_thenCorrect() throws IOException {
|
public void whenPostJson_thenCorrect() throws IOException {
|
||||||
final String json = "{\"id\":1,\"name\":\"John\"}";
|
final String json = "{\"id\":1,\"name\":\"John\"}";
|
||||||
|
|
||||||
client = new OkHttpClient();
|
|
||||||
|
|
||||||
final RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "{\"id\":1,\"name\":\"John\"}");
|
final RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "{\"id\":1,\"name\":\"John\"}");
|
||||||
final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build();
|
final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue