소스 검색

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
Rob Winch 3 달 전
부모
커밋
6118587ff8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      web/src/test/java/org/springframework/security/web/jackson2/SavedCookieMixinTests.java

+ 1 - 1
web/src/test/java/org/springframework/security/web/jackson2/SavedCookieMixinTests.java

@@ -88,7 +88,7 @@ public class SavedCookieMixinTests extends AbstractMixinTests {
 
 	@Test
 	public void deserializeSavedCookieJsonTest() throws IOException {
-		SavedCookie savedCookie = this.mapper.readValue(COOKIE_JSON, SavedCookie.class);
+		SavedCookie savedCookie = (SavedCookie) this.mapper.readValue(COOKIE_JSON, Object.class);
 		assertThat(savedCookie).isNotNull();
 		assertThat(savedCookie.getName()).isEqualTo("SESSION");
 		assertThat(savedCookie.getValue()).isEqualTo("123456789");