diff --git a/config/src/test/java/org/springframework/security/config/web/server/OidcLogoutSpecTests.java b/config/src/test/java/org/springframework/security/config/web/server/OidcLogoutSpecTests.java index a169c40d92..4d6a844532 100644 --- a/config/src/test/java/org/springframework/security/config/web/server/OidcLogoutSpecTests.java +++ b/config/src/test/java/org/springframework/security/config/web/server/OidcLogoutSpecTests.java @@ -50,6 +50,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.core.ParameterizedTypeReference; import org.springframework.core.annotation.Order; import org.springframework.http.ResponseCookie; import org.springframework.http.client.reactive.ClientHttpConnector; @@ -97,6 +98,7 @@ import org.springframework.web.server.WebSession; import org.springframework.web.server.adapter.WebHttpHandlerBuilder; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.hasValue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.atLeastOnce; @@ -195,7 +197,10 @@ public class OidcLogoutSpecTests { .body(BodyInserters.fromFormData("logout_token", "invalid")) .exchange() .expectStatus() - .isBadRequest(); + .isBadRequest() + .expectBody(new ParameterizedTypeReference>() { + }) + .value(hasValue("invalid_request")); this.test.get().uri("/token/logout").cookie("SESSION", session).exchange().expectStatus().isOk(); } @@ -262,9 +267,10 @@ public class OidcLogoutSpecTests { .exchange() .expectStatus() .isBadRequest() - .expectBody(String.class) - .value(containsString("partial_logout")) - .value(containsString("not all sessions were terminated")); + .expectBody(new ParameterizedTypeReference>() { + }) + .value(hasValue("partial_logout")) + .value(hasValue(containsString("not all sessions were terminated"))); this.test.get().uri("/token/logout").cookie("SESSION", one).exchange().expectStatus().isOk(); }