File tree Expand file tree Collapse file tree
spring-5/src/test/java/com/baeldung/functional Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import org .springframework .util .LinkedMultiValueMap ;
1313import org .springframework .util .MultiValueMap ;
1414import org .springframework .web .reactive .function .BodyInserters ;
15+
1516import static org .springframework .web .reactive .function .BodyInserters .fromObject ;
1617import static org .springframework .web .reactive .function .BodyInserters .fromResource ;
1718
18-
1919public class FunctionalWebApplicationIntegrationTest {
2020
2121 private static WebTestClient client ;
@@ -74,9 +74,7 @@ public void givenLoginForm_whenPostValidToken_thenSuccess() throws Exception {
7474 .expectStatus ()
7575 .isOk ()
7676 .expectBody (String .class )
77- .returnResult ()
78- .getResponseBody ()
79- .equals ("welcome back!" );
77+ .isEqualTo ("welcome back!" );
8078 }
8179
8280 @ Test
@@ -95,7 +93,7 @@ public void givenLoginForm_whenRequestWithInvalidToken_thenFail() throws Excepti
9593 .isBadRequest ();
9694 }
9795
98- @ Test
96+ @ Test
9997 public void givenUploadForm_whenRequestWithMultipartData_thenSuccess () throws Exception {
10098 Resource resource = new ClassPathResource ("/baeldung-weekly.png" );
10199 client
@@ -107,12 +105,10 @@ public void givenUploadForm_whenRequestWithMultipartData_thenSuccess() throws Ex
107105 .expectStatus ()
108106 .isOk ()
109107 .expectBody (String .class )
110- .returnResult ()
111- .getResponseBody ()
112- .equals (String .valueOf (resource .contentLength ()));
108+ .isEqualTo (String .valueOf (resource .contentLength ()));
113109 }
114-
115- @ Test
110+
111+ @ Test
116112 public void givenActors_whenAddActor_thenAdded () throws Exception {
117113 client
118114 .get ()
You can’t perform that action at this time.
0 commit comments