Skip to content

Commit 3daf23a

Browse files
author
Grzegorz Piwowarek
committed
Refactor OkHttp examples
1 parent ec13234 commit 3daf23a

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ public void whenAsynchronousGetRequest_thenCorrect() throws InterruptedException
6060
Call call = client.newCall(request);
6161

6262
call.enqueue(new Callback() {
63-
6463
public void onResponse(Call call, Response response) throws IOException {
65-
assertThat(response.code(), equalTo(200));
64+
System.out.println("OK");
6665
}
6766

6867
public void onFailure(Call call, IOException e) {

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
package org.baeldung.okhttp;
22

3+
import okhttp3.*;
4+
import org.junit.Test;
5+
import org.slf4j.Logger;
6+
import org.slf4j.LoggerFactory;
7+
38
import java.io.File;
49
import java.io.IOException;
510
import java.util.concurrent.Executors;
611
import java.util.concurrent.ScheduledExecutorService;
712
import java.util.concurrent.TimeUnit;
813

9-
import org.junit.Test;
10-
import org.slf4j.Logger;
11-
import org.slf4j.LoggerFactory;
12-
13-
import okhttp3.Cache;
14-
import okhttp3.Call;
15-
import okhttp3.OkHttpClient;
16-
import okhttp3.Request;
17-
import okhttp3.Response;
18-
1914
public class OkHttpMiscLiveTest {
2015

2116
private static final String BASE_URL = "http://localhost:8080/spring-rest";

0 commit comments

Comments
 (0)