Code improvement
This commit is contained in:
parent
35dbb1cfb0
commit
91faa251d5
@ -22,7 +22,7 @@ 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";
|
||||||
|
|
||||||
//@Test
|
@Test
|
||||||
public void whenGetRequest_thenCorrect() throws IOException {
|
public void whenGetRequest_thenCorrect() throws IOException {
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
@ -37,7 +37,7 @@ public class OkHttpGetLiveTest {
|
|||||||
assertThat(response.code(), equalTo(200));
|
assertThat(response.code(), equalTo(200));
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
@Test
|
||||||
public void whenGetRequestWithQueryParameter_thenCorrect() throws IOException {
|
public void whenGetRequestWithQueryParameter_thenCorrect() throws IOException {
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
@ -71,12 +71,10 @@ public class OkHttpGetLiveTest {
|
|||||||
call.enqueue(new Callback() {
|
call.enqueue(new Callback() {
|
||||||
|
|
||||||
public void onResponse(Call call, Response response) throws IOException {
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
|
||||||
assertThat(response.code(), equalTo(200));
|
assertThat(response.code(), equalTo(200));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Call call, IOException e) {
|
public void onFailure(Call call, IOException e) {
|
||||||
|
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user