Skip to content

Commit 056f896

Browse files
committed
nit
1 parent ab37465 commit 056f896

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

client/src/test/java/org/asynchttpclient/PostWithQSTest.java renamed to client/src/test/java/org/asynchttpclient/PostWithQueryStringTest.java

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
*
4141
* @author Hubert Iwaniuk
4242
*/
43-
public class PostWithQSTest extends AbstractBasicTest {
43+
public class PostWithQueryStringTest extends AbstractBasicTest {
4444

4545
@Test
46-
public void postWithQS() throws IOException, ExecutionException, TimeoutException, InterruptedException {
46+
public void postWithQueryString() throws IOException, ExecutionException, TimeoutException, InterruptedException {
4747
try (AsyncHttpClient client = asyncHttpClient()) {
4848
Future<Response> f = client.preparePost("http://localhost:" + port1 + "/?a=b").setBody("abc".getBytes()).execute();
4949
Response resp = f.get(3, TimeUnit.SECONDS);
@@ -53,27 +53,7 @@ public void postWithQS() throws IOException, ExecutionException, TimeoutExceptio
5353
}
5454

5555
@Test
56-
public void postWithNulParamQS() throws IOException, ExecutionException, TimeoutException, InterruptedException {
57-
try (AsyncHttpClient client = asyncHttpClient()) {
58-
Future<Response> f = client.preparePost("http://localhost:" + port1 + "/?a=").setBody("abc".getBytes()).execute(new AsyncCompletionHandlerBase() {
59-
60-
@Override
61-
public State onStatusReceived(final HttpResponseStatus status) throws Exception {
62-
if (!status.getUri().toUrl().equals("http://localhost:" + port1 + "/?a=")) {
63-
throw new IOException(status.getUri().toUrl());
64-
}
65-
return super.onStatusReceived(status);
66-
}
67-
68-
});
69-
Response resp = f.get(3, TimeUnit.SECONDS);
70-
assertNotNull(resp);
71-
assertEquals(resp.getStatusCode(), HttpServletResponse.SC_OK);
72-
}
73-
}
74-
75-
@Test
76-
public void postWithNulParamsQS() throws IOException, ExecutionException, TimeoutException, InterruptedException {
56+
public void postWithNullQueryParam() throws IOException, ExecutionException, TimeoutException, InterruptedException {
7757
try (AsyncHttpClient client = asyncHttpClient()) {
7858
Future<Response> f = client.preparePost("http://localhost:" + port1 + "/?a=b&c&d=e").setBody("abc".getBytes()).execute(new AsyncCompletionHandlerBase() {
7959

@@ -93,7 +73,7 @@ public State onStatusReceived(final HttpResponseStatus status) throws Exception
9373
}
9474

9575
@Test
96-
public void postWithEmptyParamsQS() throws IOException, ExecutionException, TimeoutException, InterruptedException {
76+
public void postWithEmptyParamsQueryString() throws IOException, ExecutionException, TimeoutException, InterruptedException {
9777
try (AsyncHttpClient client = asyncHttpClient()) {
9878
Future<Response> f = client.preparePost("http://localhost:" + port1 + "/?a=b&c=&d=e").setBody("abc".getBytes()).execute(new AsyncCompletionHandlerBase() {
9979

@@ -114,13 +94,13 @@ public State onStatusReceived(final HttpResponseStatus status) throws Exception
11494

11595
@Override
11696
public AbstractHandler configureHandler() throws Exception {
117-
return new PostWithQSHandler();
97+
return new PostWithQueryStringHandler();
11898
}
11999

120100
/**
121-
* POST with QS server part.
101+
* POST with QueryString server part.
122102
*/
123-
private class PostWithQSHandler extends AbstractHandler {
103+
private class PostWithQueryStringHandler extends AbstractHandler {
124104
public void handle(String s, Request r, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
125105
if ("POST".equalsIgnoreCase(request.getMethod())) {
126106
String qs = request.getQueryString();

0 commit comments

Comments
 (0)