File tree 2 files changed +46
-1
lines changed
afterburner/src/test/java/com/fasterxml/jackson/module/afterburner
2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .module .afterburner .failing ;
2
+
3
+ import com .fasterxml .jackson .databind .ObjectMapper ;
4
+ import com .fasterxml .jackson .module .afterburner .AfterburnerTestBase ;
5
+
6
+ public class GenericSerialize4Test extends AfterburnerTestBase
7
+ {
8
+ public static abstract class AbstractMyClass <ID > {
9
+
10
+ private ID id ;
11
+
12
+ AbstractMyClass (ID id ) {
13
+ setId (id );
14
+ }
15
+
16
+ public ID getId () {
17
+ return id ;
18
+ }
19
+
20
+ public void setId (ID id ) {
21
+ this .id = id ;
22
+ }
23
+ }
24
+
25
+ public static class MyClass extends AbstractMyClass <String > {
26
+ public MyClass (String id ) {
27
+ super (id );
28
+ }
29
+ }
30
+
31
+ /*
32
+ /**********************************************************
33
+ /* Unit tests
34
+ /**********************************************************
35
+ */
36
+
37
+ final private ObjectMapper MAPPER = mapperWithModule ();
38
+
39
+ public void testGenericIssue4 () throws Exception
40
+ {
41
+ MyClass input = new MyClass ("foo" );
42
+ String json = MAPPER .writeValueAsString (input );
43
+ assertEquals ("{\" id\" :\" foo\" }" , json );
44
+ }
45
+ }
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ static class NonEmptyDouble {
144
144
/**********************************************************
145
145
*/
146
146
147
- final private ObjectMapper MAPPER = new ObjectMapper ();
147
+ final private ObjectMapper MAPPER = mapperWithModule ();
148
148
149
149
public void testGlobal () throws IOException
150
150
{
You can’t perform that action at this time.
0 commit comments