Skip to content

Commit 7447996

Browse files
committed
Fix Spring 5 tests
1 parent e72744d commit 7447996

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎spring-5/src/main/java/com/baeldung/functional/FormHandler.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Mono<ServerResponse> handleLogin(ServerRequest request) {
2121
.filter(formData -> "baeldung".equals(formData.get("user")))
2222
.filter(formData -> "you_know_what_to_do".equals(formData.get("token")))
2323
.flatMap(formData -> ok().body(Mono.just("welcome back!"), String.class))
24-
.or(ServerResponse.badRequest().build());
24+
.switchIfEmpty(ServerResponse.badRequest().build());
2525
}
2626

2727
Mono<ServerResponse> handleUpload(ServerRequest request) {
@@ -34,8 +34,7 @@ Mono<ServerResponse> handleUpload(ServerRequest request) {
3434
.asByteBuffer()
3535
.array().length));
3636

37-
return ok()
38-
.body(fromObject(atomicLong.toString()));
37+
return ok().body(fromObject(atomicLong.toString()));
3938
});
4039
}
4140
}

0 commit comments

Comments
 (0)