|
50 | 50 | import org.springframework.context.annotation.Bean; |
51 | 51 | import org.springframework.context.annotation.Configuration; |
52 | 52 | import org.springframework.context.annotation.Import; |
| 53 | +import org.springframework.core.ParameterizedTypeReference; |
53 | 54 | import org.springframework.core.annotation.Order; |
54 | 55 | import org.springframework.http.ResponseCookie; |
55 | 56 | import org.springframework.http.client.reactive.ClientHttpConnector; |
|
97 | 98 | import org.springframework.web.server.adapter.WebHttpHandlerBuilder; |
98 | 99 |
|
99 | 100 | import static org.hamcrest.Matchers.containsString; |
| 101 | +import static org.hamcrest.Matchers.hasValue; |
100 | 102 | import static org.mockito.ArgumentMatchers.any; |
101 | 103 | import static org.mockito.BDDMockito.given; |
102 | 104 | import static org.mockito.Mockito.atLeastOnce; |
@@ -195,7 +197,10 @@ void logoutWhenInvalidLogoutTokenThenBadRequest() { |
195 | 197 | .body(BodyInserters.fromFormData("logout_token", "invalid")) |
196 | 198 | .exchange() |
197 | 199 | .expectStatus() |
198 | | - .isBadRequest(); |
| 200 | + .isBadRequest() |
| 201 | + .expectBody(new ParameterizedTypeReference<Map<String, String>>() { |
| 202 | + }) |
| 203 | + .value(hasValue("invalid_request")); |
199 | 204 | this.test.get().uri("/token/logout").cookie("SESSION", session).exchange().expectStatus().isOk(); |
200 | 205 | } |
201 | 206 |
|
@@ -262,9 +267,10 @@ void logoutWhenRemoteLogoutUriThenUses() { |
262 | 267 | .exchange() |
263 | 268 | .expectStatus() |
264 | 269 | .isBadRequest() |
265 | | - .expectBody(String.class) |
266 | | - .value(containsString("partial_logout")) |
267 | | - .value(containsString("not all sessions were terminated")); |
| 270 | + .expectBody(new ParameterizedTypeReference<Map<String, String>>() { |
| 271 | + }) |
| 272 | + .value(hasValue("partial_logout")) |
| 273 | + .value(hasValue(containsString("not all sessions were terminated"))); |
268 | 274 | this.test.get().uri("/token/logout").cookie("SESSION", one).exchange().expectStatus().isOk(); |
269 | 275 | } |
270 | 276 |
|
|
0 commit comments