Skip to content

Commit 5be95f7

Browse files
committed
Update tests only - move from deprecated http client methods get() to GET() etc
1 parent e0e9128 commit 5be95f7

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

tests/test-helidon/src/test/java/org/example/FooControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void getWithMatrixParam() {
5858
.path("2011").matrixParam("author", "rob").matrixParam("country", "nz")
5959
.path("foo")
6060
.queryParam("extra", "banana")
61-
.get()
61+
.GET()
6262
.asString();
6363

6464
assertThat(res.statusCode()).isEqualTo(200);

tests/test-helidon/src/test/java/org/example/ReqScopedControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void testGet() {
1616

1717
final HttpResponse<String> res = client.request()
1818
.path("req-scoped")
19-
.get().asString();
19+
.GET().asString();
2020

2121
assertThat(res.statusCode()).isEqualTo(200);
2222
assertThat(res.body()).isEqualTo("/req-scoped-200 OK");

tests/test-javalin/src/test/java/org/example/myapp/HelloControllerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void hello() {
4848
assertThat(response.statusCode()).isEqualTo(200);
4949

5050
final HttpResponse<String> hres = clientContext.request().path("hello").path("message")
51-
.get().asString();
51+
.GET().asString();
5252

5353
assertThat(hres.body()).contains("hello world");
5454
assertThat(hres.statusCode()).isEqualTo(200);
@@ -69,7 +69,7 @@ void hello2() {
6969

7070
final List<HelloDto> helloDtos = clientContext.request()
7171
.path("hello")
72-
.get().list(HelloDto.class);
72+
.GET().list(HelloDto.class);
7373

7474
assertThat(helloDtos).hasSize(2);
7575
}
@@ -90,7 +90,7 @@ void getWithPathParamAndQueryParam() {
9090

9191
final HelloDto dto = clientContext.request()
9292
.path("hello/43/2020-03-05").queryParam("otherParam", "other").queryParam("foo", null)
93-
.get().bean(HelloDto.class);
93+
.GET().bean(HelloDto.class);
9494

9595
assertThat(dto.id).isEqualTo(43L);
9696
assertThat(dto.name).isEqualTo("2020-03-05");
@@ -113,7 +113,7 @@ void postIt() {
113113
final HelloDto bean = clientContext.request()
114114
.path("hello")
115115
.body(from.write(dto))
116-
.post()
116+
.POST()
117117
.read(toDto);
118118

119119
assertEquals("posted", bean.name);
@@ -166,7 +166,7 @@ void postForm3_controllerFormBean_responseJsonDto() {
166166
.formParam("email", "[email protected]")
167167
.formParam("url", "http://foo.com")
168168
.formParam("startDate", "2030-12-03")
169-
.post().bean(HelloDto.class);
169+
.POST().bean(HelloDto.class);
170170

171171
assertThat(bean.name).isEqualTo("Bax");
172172
assertThat(bean.otherParam).isEqualTo("[email protected]");
@@ -210,7 +210,7 @@ void postForm_validation_expect_badRequest() {
210210
.path("hello/saveform")
211211
.formParam("email", "[email protected]")
212212
.formParam("url", "notAValidUrl")
213-
.post()
213+
.POST()
214214
.asVoid();
215215

216216
} catch (HttpException e) {
@@ -276,7 +276,7 @@ void getWithMatrixParam() {
276276
.path("foo")
277277
.queryParam("extra", "banana")
278278

279-
.get().asString();
279+
.GET().asString();
280280

281281
assertEquals(200, httpRes.statusCode());
282282
assertEquals("yr:2011 au:rob co:nz other:foo extra:banana", httpRes.body());

tests/test-javalin/src/test/java/org/example/myapp/ReqScopedControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void testGet() {
1616

1717
final HttpResponse<String> res = client.request()
1818
.path("req-scoped")
19-
.get().asString();
19+
.GET().asString();
2020

2121
assertThat(res.statusCode()).isEqualTo(200);
2222
assertThat(res.body()).isEqualTo("http://localhost:8887/req-scoped");

tests/test-jex/src/test/java/org/example/web/HelloControllerTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class HelloControllerTest extends BaseWebTest {
1414

1515
@Test
1616
void getHello() {
17-
final HelloDto hello = client.request().get().bean(HelloDto.class);
17+
final HelloDto hello = client.request().GET().bean(HelloDto.class);
1818

1919
assertEquals(42, hello.id);
2020
assertEquals("rob", hello.name);
@@ -23,7 +23,7 @@ void getHello() {
2323
@Test
2424
void getPlain() {
2525

26-
final HttpResponse<String> res = client.request().path("plain").get().asString();
26+
final HttpResponse<String> res = client.request().path("plain").GET().asString();
2727

2828
assertEquals("something", res.body());
2929
assertThat(res.headers().firstValue("content-type").get()).startsWith("text/plain;");
@@ -32,12 +32,12 @@ void getPlain() {
3232
@Test
3333
void getName() {
3434

35-
assertEquals("hi bazz", client.request().path("other/bazz").get().asString().body());
36-
assertEquals("hi bax", client.request().path("other/bax").get().asString().body());
35+
assertEquals("hi bazz", client.request().path("other/bazz").GET().asString().body());
36+
assertEquals("hi bax", client.request().path("other/bax").GET().asString().body());
3737
}
3838

3939
@Test
4040
void splat() {
41-
assertEquals("got name:one splat0:a/b splat1:x/y/z", client.request().path("splat/one/a/b/other/x/y/z").get().asString().body());
41+
assertEquals("got name:one splat0:a/b splat1:x/y/z", client.request().path("splat/one/a/b/other/x/y/z").GET().asString().body());
4242
}
4343
}

0 commit comments

Comments
 (0)