File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
src/test/java/com/fasterxml/jackson Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .List ;
4
4
import java .util .Map ;
5
5
6
- import com .fasterxml .jackson .annotation .JsonCreator ;
7
- import com .fasterxml .jackson .annotation .JsonProperty ;
8
6
import com .fasterxml .jackson .annotation .JsonSetter ;
9
7
import com .fasterxml .jackson .annotation .Nulls ;
10
8
import com .fasterxml .jackson .core .type .TypeReference ;
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .failing ;
2
+
3
+ import com .fasterxml .jackson .annotation .*;
4
+
5
+ import com .fasterxml .jackson .databind .*;
6
+
7
+ public class NullConversionWithCreatorTest extends BaseMapTest
8
+ {
9
+ static class EmptyFromNullViaCreator {
10
+ Point p ;
11
+
12
+ @ JsonCreator (mode = JsonCreator .Mode .PROPERTIES )
13
+ public EmptyFromNullViaCreator (@ JsonSetter (nulls =Nulls .AS_EMPTY )
14
+ @ JsonProperty ("p" ) Point p )
15
+ {
16
+ this .p = p ;
17
+ }
18
+ }
19
+
20
+ /*
21
+ /**********************************************************
22
+ /* Test methods
23
+ /**********************************************************
24
+ */
25
+ private final ObjectMapper MAPPER = newObjectMapper ();
26
+
27
+ public void testEmptyFromNullViaCreator () throws Exception
28
+ {
29
+ EmptyFromNullViaCreator result = MAPPER .readValue (aposToQuotes ("{'p':null}" ),
30
+ EmptyFromNullViaCreator .class );
31
+ assertNotNull (result );
32
+ assertNotNull (result .p );
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments