Skip to content

Commit ee95f0c

Browse files
committed
Removed redundant initialization of client
1 parent 3c050f7 commit ee95f0c

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

‎spring-rest/src/test/java/org/baeldung/okhttp/OkHttpPostingLiveTest.java‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ public void whenSendPostRequest_thenCorrect() throws IOException {
4949
public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException {
5050
final String postBody = "test post";
5151

52-
client = new OkHttpClient();
53-
5452
final Request request = new Request.Builder()
5553
.url(URL_SECURED_BY_BASIC_AUTHENTICATION)
5654
.addHeader("Authorization", Credentials.basic("test", "test"))
@@ -67,8 +65,6 @@ public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOExceptio
6765
public void whenPostJson_thenCorrect() throws IOException {
6866
final String json = "{\"id\":1,\"name\":\"John\"}";
6967

70-
client = new OkHttpClient();
71-
7268
final RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "{\"id\":1,\"name\":\"John\"}");
7369
final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build();
7470

0 commit comments

Comments
 (0)