-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
2a07652
commit f0e05b8
Showing
2 changed files
with
41 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
31 changes: 31 additions & 0 deletions
31
...c/test/java/com/fasterxml/jackson/dataformat/yaml/failing/NullFromEmptyString130Test.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,31 @@ | ||
package com.fasterxml.jackson.dataformat.yaml.failing; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.dataformat.yaml.ModuleTestBase; | ||
|
||
// [dataformats-text#130]: Easy enough to fix, if we choose to, | ||
// but due to timing cannot include in 2.12 (too close to release | ||
// after RCs) | ||
// | ||
// Fix to be done by ignoring snakeyaml's implicit type for case of | ||
// empty String (in `YAMLParser. | ||
public class NullFromEmptyString130Test extends ModuleTestBase | ||
{ | ||
static class Value130 { | ||
public String value; | ||
|
||
public void setValue(String str) { | ||
value = str; | ||
} | ||
} | ||
|
||
private final ObjectMapper MAPPER = newObjectMapper(); | ||
|
||
// [dataformats-text#130] | ||
public void testEmptyValueToNull130() throws Exception | ||
{ | ||
Value130 v = MAPPER.readerFor(Value130.class) | ||
.readValue("value: \n"); | ||
assertEquals("", v.value); | ||
} | ||
} |