99import java .util .Map ;
1010
1111import static org .assertj .core .api .Assertions .assertThat ;
12- import static org .junit .jupiter .api .Assertions .assertEquals ;
13- import static org .junit .jupiter .api .Assertions .assertNotNull ;
14- import static org .junit .jupiter .api .Assertions .fail ;
12+ import static org .junit .jupiter .api .Assertions .*;
1513
1614class HelloControllerTest extends BaseWebTest {
1715
@@ -22,7 +20,7 @@ void get_helloMessage() {
2220
2321 final HttpResponse <String > hres = clientContext .request ()
2422 .path ("hello" ).path ("message" )
25- .get ().asString ();
23+ .GET ().asString ();
2624
2725 assertThat (hres .body ()).contains ("hello world" );
2826 assertThat (hres .statusCode ()).isEqualTo (200 );
@@ -34,7 +32,7 @@ void get_helloMessage_via_url() {
3432 final HttpResponse <String > hres = clientContext .request ()
3533 .url ("http://127.0.0.1:8887" )
3634 .path ("hello" ).path ("message" )
37- .get ().asString ();
35+ .GET ().asString ();
3836
3937 assertThat (hres .body ()).contains ("hello world" );
4038 assertThat (hres .statusCode ()).isEqualTo (200 );
@@ -45,7 +43,7 @@ void get_hello_returningListOfBeans() {
4543
4644 final List <HelloDto > helloDtos = clientContext .request ()
4745 .path ("hello" )
48- .get ().list (HelloDto .class );
46+ .GET ().list (HelloDto .class );
4947
5048 assertThat (helloDtos ).hasSize (2 );
5149 }
@@ -54,8 +52,9 @@ void get_hello_returningListOfBeans() {
5452 void get_withPathParamAndQueryParam_returningBean () {
5553
5654 final HelloDto dto = clientContext .request ()
57- .path ("hello/43/2020-03-05" ).queryParam ("otherParam" , "other" ).queryParam ("foo" , (String ) null )
58- .get ().bean (HelloDto .class );
55+ .path ("hello/43/2020-03-05" ).queryParam ("otherParam" , "other" ).queryParam ("foo" , null )
56+ .GET ()
57+ .bean (HelloDto .class );
5958
6059 assertThat (dto .id ).isEqualTo (43L );
6160 assertThat (dto .name ).isEqualTo ("2020-03-05" );
@@ -73,7 +72,7 @@ void post_bean_returningBean_usingExplicitConverters() {
7372 final HelloDto bean = clientContext .request ()
7473 .path ("hello" )
7574 .body (from .write (dto ))
76- .post ()
75+ .POST ()
7776 .read (toDto );
7877
7978 assertEquals ("posted" , bean .name );
@@ -87,7 +86,8 @@ void post_bean_returningVoid() {
8786
8887 final HttpResponse <Void > res = clientContext .request ()
8988 .path ("hello/savebean/foo" )
90- .body (dto ).post ()
89+ .body (dto )
90+ .POST ()
9191 .asDiscarding ();
9292
9393 assertThat (res .statusCode ()).isEqualTo (201 );
@@ -102,7 +102,7 @@ void postForm() {
102102 .formParam ("email" , "user@foo.com" )
103103 .formParam ("url" , "http://foo.com" )
104104 .formParam ("startDate" , "2030-12-03" )
105- .post ()
105+ .POST ()
106106 .asDiscarding ();
107107
108108 assertThat (res .statusCode ()).isEqualTo (201 );
@@ -117,7 +117,7 @@ void postForm_returningBean() {
117117 .formParam ("email" , "user@foo.com" )
118118 .formParam ("url" , "http://foo.com" )
119119 .formParam ("startDate" , "2030-12-03" )
120- .post ()
120+ .POST ()
121121 .asDiscarding ();
122122
123123 assertThat (res .statusCode ()).isEqualTo (201 );
@@ -128,7 +128,7 @@ void postForm_returningBean() {
128128 .formParam ("email" , "Bax@foo.com" )
129129 .formParam ("url" , "http://foo.com" )
130130 .formParam ("startDate" , "2030-12-03" )
131- .post ()
131+ .POST ()
132132 .bean (HelloDto .class );
133133
134134 assertThat (bean .name ).isEqualTo ("Bax" );
@@ -143,7 +143,7 @@ void postForm_asVoid_validResponse() {
143143 .formParam ("name" , "baz" )
144144 .formParam ("email" , "user@foo.com" )
145145 .formParam ("url" , "http://foo" )
146- .post ()
146+ .POST ()
147147 .asVoid ();
148148
149149 assertEquals (201 , res .statusCode ());
@@ -156,7 +156,7 @@ void postForm_asVoid_invokesValidation_expect_badRequest_extractError() {
156156 .path ("hello/saveform" )
157157 .formParam ("email" , "user@foo.com" )
158158 .formParam ("url" , "notAValidUrl" )
159- .post ()
159+ .POST ()
160160 .asVoid ();
161161
162162 fail ();
@@ -183,7 +183,7 @@ void postForm_asBytes_validation_expect_badRequest_extractError() {
183183 .path ("hello/saveform" )
184184 .formParam ("email" , "user@foo.com" )
185185 .formParam ("url" , "notAValidUrl" )
186- .post ().asVoid ();
186+ .POST ().asVoid ();
187187
188188 fail ();
189189
@@ -212,7 +212,8 @@ void delete() {
212212 final HttpResponse <Void > res =
213213 clientContext .request ()
214214 .path ("hello/52" )
215- .delete ().asDiscarding ();
215+ .DELETE ()
216+ .asDiscarding ();
216217
217218 assertThat (res .statusCode ()).isEqualTo (204 );
218219 }
@@ -226,7 +227,8 @@ void get_withMatrixParam() {
226227 .matrixParam ("country" , "nz" )
227228 .path ("foo" )
228229 .queryParam ("extra" , "banana" )
229- .get ().asString ();
230+ .GET ()
231+ .asString ();
230232
231233 assertEquals (200 , httpRes .statusCode ());
232234 assertEquals ("yr:2011 au:rob co:nz other:foo extra:banana" , httpRes .body ());
0 commit comments