-
-
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
d2c4061
commit 7a4b7af
Showing
2 changed files
with
72 additions
and
46 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
30 changes: 30 additions & 0 deletions
30
src/test/java/com/fasterxml/jackson/databind/creators/EnumCreatorTest.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,30 @@ | ||
package com.fasterxml.jackson.databind.creators; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.databind.*; | ||
|
||
public class EnumCreatorTest extends BaseMapTest | ||
{ | ||
static enum MyEnum960 | ||
{ | ||
VALUE, BOGUS; | ||
|
||
@JsonCreator | ||
public static MyEnum960 getInstance() { | ||
return VALUE; | ||
} | ||
} | ||
|
||
static class MyEnum960Wrapper { | ||
public MyEnum960 value; | ||
} | ||
|
||
private final ObjectMapper MAPPER = new ObjectMapper(); | ||
|
||
// for [databind#960] | ||
public void testNoArgEnumCreator() throws Exception | ||
{ | ||
MyEnum960 v = MAPPER.readValue("{\"value\":\"bogus\"}", MyEnum960.class); | ||
assertEquals(MyEnum960.VALUE, v); | ||
} | ||
} |