Skip to content

Commit 40621d6

Browse files
committed
Update tests
1 parent 1a54133 commit 40621d6

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎spring-5/src/test/java/com/baeldung/functional/FunctionalWebApplicationIntegrationTest.java‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
import org.springframework.util.LinkedMultiValueMap;
1313
import org.springframework.util.MultiValueMap;
1414
import org.springframework.web.reactive.function.BodyInserters;
15+
1516
import static org.springframework.web.reactive.function.BodyInserters.fromObject;
1617
import static org.springframework.web.reactive.function.BodyInserters.fromResource;
1718

18-
1919
public 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()

0 commit comments

Comments
 (0)