File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/failing Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 17
17
package com .fasterxml .jackson .datatype .jsr310 .failing ;
18
18
19
19
import java .time .Year ;
20
- import java .time .temporal .Temporal ;
21
20
22
21
import com .fasterxml .jackson .annotation .JsonFormat ;
23
22
import com .fasterxml .jackson .databind .ObjectMapper ;
24
- import com .fasterxml .jackson .datatype .jsr310 .MockObjectConfiguration ;
25
23
import com .fasterxml .jackson .datatype .jsr310 .ModuleTestBase ;
26
24
27
25
import org .junit .Test ;
28
26
29
27
import static org .junit .Assert .assertEquals ;
30
- import static org .junit .Assert .assertTrue ;
31
28
32
29
public class YearDeser78Test extends ModuleTestBase
33
30
{
@@ -36,6 +33,7 @@ final static class ObjectTest {
36
33
@ JsonFormat (shape = JsonFormat .Shape .STRING , pattern = "'Y'yyyy" )
37
34
public Year value ;
38
35
36
+ protected ObjectTest () { }
39
37
public ObjectTest (Year y ) {
40
38
value = y ;
41
39
}
@@ -49,7 +47,7 @@ public void testWithCustomFormat() throws Exception
49
47
{
50
48
ObjectTest input = new ObjectTest (Year .of (2018 ));
51
49
String json = MAPPER .writeValueAsString (input );
52
- assertEquals ("{\" customYear \" :\" Y2018\" }" , json );
50
+ assertEquals ("{\" value \" :\" Y2018\" }" , json );
53
51
ObjectTest result = MAPPER .readValue (json , ObjectTest .class );
54
52
assertEquals (input , result );
55
53
}
You can’t perform that action at this time.
0 commit comments