Skip to content

Commit b9f1ca7

Browse files
author
Stephane Landelle
committed
Don't make standalone tests target http://foo.com
1 parent 9f11892 commit b9f1ca7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

api/src/test/java/org/asynchttpclient/async/AsyncProvidersBasicTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public abstract class AsyncProvidersBasicTest extends AbstractBasicTest {
6868
public void asyncProviderEncodingTest() throws Throwable {
6969
AsyncHttpClient p = getAsyncHttpClient(null);
7070
try {
71-
Request request = new RequestBuilder("GET").setUrl("http://foo.com/foo.html%3C/span%3E?q=+%20x").build();
71+
Request request = new RequestBuilder("GET").setUrl(getTargetUrl() + "?q=+%20x").build();
7272
String requestUrl = request.getUrl();
73-
Assert.assertEquals(requestUrl, "http://foo.com/foo.html%3C/span%3E?q=%20%20x");
73+
Assert.assertEquals(requestUrl, getTargetUrl() + "?q=%20%20x");
7474
Future<String> responseFuture = p.executeRequest(request, new AsyncCompletionHandler<String>() {
7575
@Override
7676
public String onCompleted(Response response) throws Exception {
@@ -85,7 +85,7 @@ public void onThrowable(Throwable t) {
8585

8686
});
8787
String url = responseFuture.get();
88-
Assert.assertEquals(url, "http://foo.com/foo.html%3C/span%3E?q=%20%20x");
88+
Assert.assertEquals(url, getTargetUrl() + "?q=%20%20x");
8989
} finally {
9090
p.close();
9191
}
@@ -95,7 +95,7 @@ public void onThrowable(Throwable t) {
9595
public void asyncProviderEncodingTest2() throws Throwable {
9696
AsyncHttpClient p = getAsyncHttpClient(null);
9797
try {
98-
Request request = new RequestBuilder("GET").setUrl("http://foo.com/foo.html%3C/span%3E").addQueryParameter("q", "a b").build();
98+
Request request = new RequestBuilder("GET").setUrl(getTargetUrl() + "").addQueryParameter("q", "a b").build();
9999

100100
Future<String> responseFuture = p.executeRequest(request, new AsyncCompletionHandler<String>() {
101101
@Override
@@ -111,7 +111,7 @@ public void onThrowable(Throwable t) {
111111

112112
});
113113
String url = responseFuture.get();
114-
Assert.assertEquals(url, "http://foo.com/foo.html%3C/span%3E?q=a%20b");
114+
Assert.assertEquals(url, getTargetUrl() + "?q=a%20b");
115115
} finally {
116116
p.close();
117117
}
@@ -121,7 +121,7 @@ public void onThrowable(Throwable t) {
121121
public void emptyRequestURI() throws Throwable {
122122
AsyncHttpClient p = getAsyncHttpClient(null);
123123
try {
124-
Request request = new RequestBuilder("GET").setUrl("http://foo.com/").build();
124+
Request request = new RequestBuilder("GET").setUrl(getTargetUrl()).build();
125125

126126
Future<String> responseFuture = p.executeRequest(request, new AsyncCompletionHandler<String>() {
127127
@Override
@@ -137,7 +137,7 @@ public void onThrowable(Throwable t) {
137137

138138
});
139139
String url = responseFuture.get();
140-
Assert.assertEquals(url, "http://foo.com/");
140+
Assert.assertEquals(url, getTargetUrl());
141141
} finally {
142142
p.close();
143143
}

0 commit comments

Comments
 (0)