Skip to content

Commit 1068506

Browse files
committed
Add a failing test for #1098
1 parent fe32b96 commit 1068506

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
4+
5+
import com.fasterxml.jackson.databind.*;
6+
7+
public class FailingSubTypeUnknownClass1098Test extends BaseMapTest
8+
{
9+
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY,
10+
property = "clazz")
11+
abstract static class BaseClass {
12+
}
13+
14+
static class BaseWrapper {
15+
public BaseClass value;
16+
}
17+
18+
public void testUnknownClassAsSubtype() throws Exception
19+
{
20+
ObjectMapper mapper = new ObjectMapper();
21+
mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);
22+
BaseWrapper w = mapper.readValue(aposToQuotes
23+
("{'value':{'clazz':'com.foobar.Nothing'}}'"),
24+
BaseWrapper.class);
25+
assertNotNull(w);
26+
}
27+
}

0 commit comments

Comments
 (0)