File tree 1 file changed +9
-0
lines changed
core/src/test/java/org/springframework/security/jackson2
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 26
26
import org .junit .Test ;
27
27
28
28
import java .lang .annotation .*;
29
+ import java .util .HashMap ;
29
30
30
31
import static org .assertj .core .api .Assertions .assertThat ;
31
32
import static org .assertj .core .api .Assertions .fail ;
@@ -87,6 +88,14 @@ public void readValueWhenMixinProvidedThenReadsAsSpecificType() throws Exception
87
88
assertThat (mapper .readValue (content , Object .class )).isInstanceOf (NotWhitelisted .class );
88
89
}
89
90
91
+ @ Test
92
+ public void readValueWhenHashMapThenReadsAsSpecificType () throws Exception {
93
+ mapper .addMixIn (NotWhitelisted .class , NotWhitelistedMixin .class );
94
+ String content = "{\" @class\" :\" java.util.HashMap\" }" ;
95
+
96
+ assertThat (mapper .readValue (content , Object .class )).isInstanceOf (HashMap .class );
97
+ }
98
+
90
99
@ Target ({ ElementType .TYPE , ElementType .ANNOTATION_TYPE })
91
100
@ Retention (RetentionPolicy .RUNTIME )
92
101
@ Documented
You can’t perform that action at this time.
0 commit comments