From 40621d6bd7cc9439863706a8a21b464a3848b495 Mon Sep 17 00:00:00 2001 From: pivovarit Date: Fri, 5 May 2017 17:53:59 +0200 Subject: [PATCH] Update tests --- .../FunctionalWebApplicationIntegrationTest.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/spring-5/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java b/spring-5/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java index 8e88680078..cf1029c12f 100644 --- a/spring-5/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java +++ b/spring-5/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java @@ -12,10 +12,10 @@ import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.reactive.function.BodyInserters; + import static org.springframework.web.reactive.function.BodyInserters.fromObject; import static org.springframework.web.reactive.function.BodyInserters.fromResource; - public class FunctionalWebApplicationIntegrationTest { private static WebTestClient client; @@ -74,9 +74,7 @@ public class FunctionalWebApplicationIntegrationTest { .expectStatus() .isOk() .expectBody(String.class) - .returnResult() - .getResponseBody() - .equals("welcome back!"); + .isEqualTo("welcome back!"); } @Test @@ -95,7 +93,7 @@ public class FunctionalWebApplicationIntegrationTest { .isBadRequest(); } - @Test + @Test public void givenUploadForm_whenRequestWithMultipartData_thenSuccess() throws Exception { Resource resource = new ClassPathResource("/baeldung-weekly.png"); client @@ -107,12 +105,10 @@ public class FunctionalWebApplicationIntegrationTest { .expectStatus() .isOk() .expectBody(String.class) - .returnResult() - .getResponseBody() - .equals(String.valueOf(resource.contentLength())); + .isEqualTo(String.valueOf(resource.contentLength())); } - - @Test + + @Test public void givenActors_whenAddActor_thenAdded() throws Exception { client .get()