1
1
package com .fasterxml .jackson .databind .interop ;
2
2
3
+ import java .util .*;
4
+
3
5
import org .springframework .jacksontest .BogusApplicationContext ;
4
6
import org .springframework .jacksontest .BogusPointcutAdvisor ;
7
+ import org .springframework .jacksontest .GrantedAuthority ;
5
8
6
9
import com .fasterxml .jackson .annotation .JsonTypeInfo ;
7
10
import com .fasterxml .jackson .databind .*;
@@ -22,7 +25,11 @@ static class PolyWrapper {
22
25
include = JsonTypeInfo .As .WRAPPER_ARRAY )
23
26
public Object v ;
24
27
}
25
-
28
+
29
+ static class Authentication1872 {
30
+ public List <GrantedAuthority > authorities = new ArrayList <GrantedAuthority >();
31
+ }
32
+
26
33
/*
27
34
/**********************************************************
28
35
/* Unit tests
@@ -94,6 +101,18 @@ public void testC3P0Types1737() throws Exception
94
101
}
95
102
*/
96
103
104
+ // // // Tests for [databind#1872]
105
+ public void testJDKTypes1872 () throws Exception
106
+ {
107
+ ObjectMapper mapper = new ObjectMapper ();
108
+ mapper .enableDefaultTyping (ObjectMapper .DefaultTyping .NON_FINAL , JsonTypeInfo .As .PROPERTY );
109
+
110
+ String json = aposToQuotes (String .format ("{'@class':'%s','authorities':['java.util.ArrayList',[]]}" ,
111
+ Authentication1872 .class .getName ()));
112
+ Authentication1872 result = mapper .readValue (json , Authentication1872 .class );
113
+ assertNotNull (result );
114
+ }
115
+
97
116
private void _testIllegalType (Class <?> nasty ) throws Exception {
98
117
_testIllegalType (nasty .getName ());
99
118
}
0 commit comments