Skip to content

Commit

Permalink
fix: fixes checkstyle warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhichede committed Jul 16, 2024
1 parent 6707836 commit 99f4ec5
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public void testShouldParseHttpGETRequestBody() throws IOException {

@Test
public void testShouldParseHttpPOSTRequestBody() throws IOException {
HttpRequest httpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/some-path", Unpooled.copiedBuffer(("q1=xyz").getBytes()));
HttpRequest httpRequest = new DefaultFullHttpRequest(
HttpVersion.HTTP_1_1, HttpMethod.POST,
"/some-path",
Unpooled.copiedBuffer(("q1=xyz").getBytes())
);
Map<String, Object> expected = new HashMap<>();
expected.put("q1", "xyz");
Assertions.assertEquals(expected, HttpRequestUtil.parseHttpRequestBody(httpRequest));
Expand All @@ -58,13 +62,22 @@ public void testQueryStringToMap() {

@Test
public void testGetQueryParam() {
HttpRequest httpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/some-path?q1=xyz");
HttpRequest httpRequest = new DefaultFullHttpRequest(
HttpVersion.HTTP_1_1,
HttpMethod.GET,
"/some-path?q1=xyz"
);
Assertions.assertEquals("xyz", HttpRequestUtil.getQueryParam(httpRequest, "q1", ""));
}

@Test
public void testGetBodyParam() throws IOException {
HttpRequest httpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/some-path", Unpooled.copiedBuffer(("q1=xyz").getBytes()));
HttpRequest httpRequest = new DefaultFullHttpRequest(
HttpVersion.HTTP_1_1,
HttpMethod.POST,
"/some-path",
Unpooled.copiedBuffer(("q1=xyz").getBytes())
);
Assertions.assertEquals("xyz", HttpRequestUtil.getBodyParam(httpRequest, "q1"));
}

Expand Down

0 comments on commit 99f4ec5

Please sign in to comment.