compilation fix

This commit is contained in:
eugenp 2016-11-23 16:39:52 +02:00
parent 615ddc19bf
commit 2edb881680
1 changed files with 10 additions and 14 deletions

View File

@ -1,11 +1,14 @@
package org.baeldung.okhttp; package org.baeldung.okhttp;
import okhttp3.*; import static org.hamcrest.CoreMatchers.equalTo;
import org.junit.Test; import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.io.IOException; import java.io.IOException;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import okhttp3.Call; import okhttp3.Call;
import okhttp3.Callback; import okhttp3.Callback;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
@ -13,7 +16,6 @@ import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
public class OkHttpGetLiveTest { public class OkHttpGetLiveTest {
private static final String BASE_URL = "http://localhost:8080/spring-rest"; private static final String BASE_URL = "http://localhost:8080/spring-rest";
@ -28,9 +30,7 @@ public class OkHttpGetLiveTest {
@Test @Test
public void whenGetRequest_thenCorrect() throws IOException { public void whenGetRequest_thenCorrect() throws IOException {
Request request = new Request.Builder() Request request = new Request.Builder().url(BASE_URL + "/date").build();
.url(BASE_URL + "/date")
.build();
Call call = client.newCall(request); Call call = client.newCall(request);
Response response = call.execute(); Response response = call.execute();
@ -45,9 +45,7 @@ public class OkHttpGetLiveTest {
String url = urlBuilder.build().toString(); String url = urlBuilder.build().toString();
Request request = new Request.Builder() Request request = new Request.Builder().url(url).build();
.url(url)
.build();
Call call = client.newCall(request); Call call = client.newCall(request);
Response response = call.execute(); Response response = call.execute();
@ -57,9 +55,7 @@ public class OkHttpGetLiveTest {
@Test @Test
public void whenAsynchronousGetRequest_thenCorrect() throws InterruptedException { public void whenAsynchronousGetRequest_thenCorrect() throws InterruptedException {
Request request = new Request.Builder() Request request = new Request.Builder().url(BASE_URL + "/date").build();
.url(BASE_URL + "/date")
.build();
Call call = client.newCall(request); Call call = client.newCall(request);