-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6fbed5
commit c62d8c7
Showing
4 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/test/java/com/fasterxml/jackson/failing/JavaTypeDesc1301Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.fasterxml.jackson.failing; | ||
|
||
import java.util.HashMap; | ||
|
||
import com.fasterxml.jackson.databind.BaseMapTest; | ||
import com.fasterxml.jackson.databind.type.TypeFactory; | ||
|
||
@SuppressWarnings("serial") | ||
public class JavaTypeDesc1301Test extends BaseMapTest | ||
{ | ||
static class DataDefinition extends HashMap<String, DataDefinition> { | ||
public DataDefinition definition; | ||
public DataDefinition elements; | ||
public String regex; | ||
public boolean required; | ||
public String type; | ||
} | ||
|
||
// for [databind#1301] | ||
public void testJavaTypeToString() throws Exception | ||
{ | ||
TypeFactory tf = objectMapper().getTypeFactory(); | ||
String desc = tf.constructType(DataDefinition.class).toString(); | ||
assertNotNull(desc); | ||
// could try comparing exact message, but since it's informational try looser: | ||
if (!desc.contains("map type")) { | ||
fail("Description should contain 'map type', did not: "+desc); | ||
} | ||
if (!desc.contains("recursive type")) { | ||
fail("Description should contain 'recursive type', did not: "+desc); | ||
} | ||
} | ||
} |