Skip to content

Commit 6118587

Browse files
committed
SavedCookieMixinTests uses readValue(String,Object.class)
The test should not provide SavedCookie.class to the ObjectMapper since this is not done in production. In particular, it provides the type that it should be deserialized, but this must be provided in the JSON since the type is unknown at the time of deserialization. Issue gh-17006
1 parent 241c3cd commit 6118587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/src/test/java/org/springframework/security/web/jackson2/SavedCookieMixinTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void deserializeSavedCookieWithList() throws IOException {
8888

8989
@Test
9090
public void deserializeSavedCookieJsonTest() throws IOException {
91-
SavedCookie savedCookie = this.mapper.readValue(COOKIE_JSON, SavedCookie.class);
91+
SavedCookie savedCookie = (SavedCookie) this.mapper.readValue(COOKIE_JSON, Object.class);
9292
assertThat(savedCookie).isNotNull();
9393
assertThat(savedCookie.getName()).isEqualTo("SESSION");
9494
assertThat(savedCookie.getValue()).isEqualTo("123456789");

0 commit comments

Comments
 (0)