Skip to content

Commit d352f0c

Browse files
committed
Move #88 test case out of 'failing' (passes now)
1 parent 0e1e878 commit d352f0c

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.fasterxml.jackson.failing;
1+
package com.fasterxml.jackson.databind.jsontype;
22

33
import com.fasterxml.jackson.annotation.JsonTypeInfo;
44
import com.fasterxml.jackson.databind.*;
55

6-
public class TestNodeTypingIssue88 extends BaseMapTest
6+
public class TestDefaultForTreeNodes extends BaseMapTest
77
{
88
public static class Foo {
99
public String bar;
@@ -17,26 +17,25 @@ public Foo() { }
1717
/* Unit tests
1818
/**********************************************************
1919
*/
20+
21+
private final ObjectMapper DEFAULT_MAPPER = new ObjectMapper();
22+
{
23+
DEFAULT_MAPPER.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
24+
}
2025

2126
public void testValueAsStringWithDefaultTyping() throws Exception
2227
{
23-
ObjectMapper mapper = new ObjectMapper();
24-
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
25-
2628
Foo foo = new Foo("baz");
27-
String json = mapper.writeValueAsString(foo);
29+
String json = DEFAULT_MAPPER.writeValueAsString(foo);
2830

29-
JsonNode jsonNode = mapper.readTree(json);
31+
JsonNode jsonNode = DEFAULT_MAPPER.readTree(json);
3032
assertEquals(jsonNode.get("bar").textValue(), foo.bar);
3133
}
3234

3335
public void testValueToTreeWithDefaultTyping() throws Exception
3436
{
35-
ObjectMapper mapper = new ObjectMapper();
36-
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
37-
3837
Foo foo = new Foo("baz");
39-
JsonNode jsonNode = mapper.valueToTree(foo);
38+
JsonNode jsonNode = DEFAULT_MAPPER.valueToTree(foo);
4039
assertEquals(jsonNode.get("bar").textValue(), foo.bar);
4140
}
4241
}

0 commit comments

Comments
 (0)