-
-
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.
Start wrok on #3394, allow @JsonAnySetter on JsonNode valued field
- Loading branch information
1 parent
7f1a3db
commit 229ddd0
Showing
2 changed files
with
32 additions
and
2 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
29 changes: 29 additions & 0 deletions
29
src/test/java/com/fasterxml/jackson/databind/deser/AnySetter3394Test.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,29 @@ | ||
package com.fasterxml.jackson.databind.deser; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
|
||
import com.fasterxml.jackson.databind.*; | ||
|
||
// for [databind#3394] | ||
public class AnySetter3394Test extends BaseMapTest | ||
{ | ||
static class AnySetter3394Bean { | ||
@JsonAnySetter | ||
public JsonNode extraData; | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Test methods | ||
/********************************************************** | ||
*/ | ||
|
||
private final ObjectMapper MAPPER = newJsonMapper(); | ||
|
||
public void testAnySetterWithJsonNode() throws Exception | ||
{ | ||
final String DOC = a2q("{'test': 3}"); | ||
AnySetter3394Bean bean = MAPPER.readValue(DOC, AnySetter3394Bean.class); | ||
assertEquals(DOC, ""+bean.extraData); | ||
} | ||
} |