Update tests

This commit is contained in:
pivovarit 2017-05-05 17:53:59 +02:00
parent 1a54133472
commit 40621d6bd7
1 changed files with 6 additions and 10 deletions

View File

@ -12,10 +12,10 @@ import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.BodyInserters;
import static org.springframework.web.reactive.function.BodyInserters.fromObject; import static org.springframework.web.reactive.function.BodyInserters.fromObject;
import static org.springframework.web.reactive.function.BodyInserters.fromResource; import static org.springframework.web.reactive.function.BodyInserters.fromResource;
public class FunctionalWebApplicationIntegrationTest { public class FunctionalWebApplicationIntegrationTest {
private static WebTestClient client; private static WebTestClient client;
@ -74,9 +74,7 @@ public class FunctionalWebApplicationIntegrationTest {
.expectStatus() .expectStatus()
.isOk() .isOk()
.expectBody(String.class) .expectBody(String.class)
.returnResult() .isEqualTo("welcome back!");
.getResponseBody()
.equals("welcome back!");
} }
@Test @Test
@ -95,7 +93,7 @@ public class FunctionalWebApplicationIntegrationTest {
.isBadRequest(); .isBadRequest();
} }
@Test @Test
public void givenUploadForm_whenRequestWithMultipartData_thenSuccess() throws Exception { public void givenUploadForm_whenRequestWithMultipartData_thenSuccess() throws Exception {
Resource resource = new ClassPathResource("/baeldung-weekly.png"); Resource resource = new ClassPathResource("/baeldung-weekly.png");
client client
@ -107,12 +105,10 @@ public class FunctionalWebApplicationIntegrationTest {
.expectStatus() .expectStatus()
.isOk() .isOk()
.expectBody(String.class) .expectBody(String.class)
.returnResult() .isEqualTo(String.valueOf(resource.contentLength()));
.getResponseBody()
.equals(String.valueOf(resource.contentLength()));
} }
@Test @Test
public void givenActors_whenAddActor_thenAdded() throws Exception { public void givenActors_whenAddActor_thenAdded() throws Exception {
client client
.get() .get()