Skip to content

Commit e4dd521

Browse files
committed
move #1311 under failing; not sure if it's valid, but shouldn't block build
1 parent e5792f6 commit e4dd521

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

src/test/java/com/fasterxml/jackson/databind/jsontype/TestSubtypes.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,4 @@ public void testIssue1125WithDefault() throws Exception
334334
assertEquals(5, impl.b);
335335
assertEquals(9, impl.def);
336336
}
337-
338-
// [databind#1311]
339-
public void testSubtypeAssignmentCheck() throws Exception
340-
{
341-
ObjectMapper mapper = new ObjectMapper();
342-
mapper.registerSubtypes(Factory1311ImplA.class, Factory1311ImplB.class);
343-
Factory1311ImplB result = mapper.readValue("{\"type\":\"implB\"}", Factory1311ImplB.class);
344-
assertNotNull(result);
345-
assertEquals(Factory1311ImplB.class, result.getClass());
346-
}
347337
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
4+
import com.fasterxml.jackson.annotation.JsonTypeName;
5+
6+
import com.fasterxml.jackson.databind.ObjectMapper;
7+
8+
// Not sure if this is valid, but for what it's worth, shows
9+
// the thing wrt [databind#1311]. May be removed if we can't find
10+
// improvements.
11+
public class TestSubtypes1311 extends com.fasterxml.jackson.databind.BaseMapTest
12+
{
13+
// [databind#1311]
14+
@JsonTypeInfo(property = "type", use = JsonTypeInfo.Id.NAME, defaultImpl = Factory1311ImplA.class)
15+
interface Factory1311 { }
16+
17+
@JsonTypeName("implA")
18+
static class Factory1311ImplA implements Factory1311 { }
19+
20+
@JsonTypeName("implB")
21+
static class Factory1311ImplB implements Factory1311 { }
22+
23+
/*
24+
/**********************************************************
25+
/* Unit tests
26+
/**********************************************************
27+
*/
28+
29+
// [databind#1311]
30+
public void testSubtypeAssignmentCheck() throws Exception
31+
{
32+
ObjectMapper mapper = new ObjectMapper();
33+
mapper.registerSubtypes(Factory1311ImplA.class, Factory1311ImplB.class);
34+
Factory1311ImplB result = mapper.readValue("{\"type\":\"implB\"}", Factory1311ImplB.class);
35+
assertNotNull(result);
36+
assertEquals(Factory1311ImplB.class, result.getClass());
37+
}
38+
}

0 commit comments

Comments
 (0)