From ee95f0cbde59bd2d97b61808e5f0d2260a1b14eb Mon Sep 17 00:00:00 2001 From: Zeger Hendrikse Date: Mon, 5 Dec 2016 23:40:39 +0100 Subject: [PATCH] Removed redundant initialization of client --- .../test/java/org/baeldung/okhttp/OkHttpPostingLiveTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spring-rest/src/test/java/org/baeldung/okhttp/OkHttpPostingLiveTest.java b/spring-rest/src/test/java/org/baeldung/okhttp/OkHttpPostingLiveTest.java index be3f5d67c9..9f9220329d 100644 --- a/spring-rest/src/test/java/org/baeldung/okhttp/OkHttpPostingLiveTest.java +++ b/spring-rest/src/test/java/org/baeldung/okhttp/OkHttpPostingLiveTest.java @@ -49,8 +49,6 @@ public class OkHttpPostingLiveTest { public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException { final String postBody = "test post"; - client = new OkHttpClient(); - final Request request = new Request.Builder() .url(URL_SECURED_BY_BASIC_AUTHENTICATION) .addHeader("Authorization", Credentials.basic("test", "test")) @@ -67,8 +65,6 @@ public class OkHttpPostingLiveTest { public void whenPostJson_thenCorrect() throws IOException { 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 Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build();