-
-
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.
… returning null
- Loading branch information
1 parent
23551ec
commit 38087ef
Showing
3 changed files
with
40 additions
and
0 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
32 changes: 32 additions & 0 deletions
32
src/test/java/com/fasterxml/jackson/databind/deser/enums/EnumWithNullToString4355Test.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,32 @@ | ||
package com.fasterxml.jackson.databind.deser.enums; | ||
|
||
import com.fasterxml.jackson.databind.*; | ||
|
||
public class EnumWithNullToString4355Test extends BaseMapTest | ||
{ | ||
// [databind#4355] | ||
enum Enum4355 { | ||
ALPHA("A"), | ||
BETA("B"), | ||
UNDEFINED(null); | ||
|
||
private final String s; | ||
|
||
Enum4355(String s) { | ||
this.s = s; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return s; | ||
} | ||
} | ||
|
||
private final ObjectMapper MAPPER = newJsonMapper(); | ||
|
||
// [databind#4355] | ||
public void testWithNullToString() throws Exception | ||
{ | ||
assertEquals("\"ALPHA\"", MAPPER.writeValueAsString(Enum4355.ALPHA)); | ||
} | ||
} |