Skip to content

Commit 8b053c6

Browse files
committed
Add a failing unit test for #4 (afterburner)
1 parent 748271b commit 8b053c6

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
}

afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/ser/JsonIncludeTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static class NonEmptyDouble {
144144
/**********************************************************
145145
*/
146146

147-
final private ObjectMapper MAPPER = new ObjectMapper();
147+
final private ObjectMapper MAPPER = mapperWithModule();
148148

149149
public void testGlobal() throws IOException
150150
{

0 commit comments

Comments
 (0)