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
3dd61ce
commit a2e3460
Showing
3 changed files
with
50 additions
and
1 deletion.
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
48 changes: 48 additions & 0 deletions
48
src/test/java/com/fasterxml/jackson/failing/IgnoredCreatorProperty1572Test.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,48 @@ | ||
package com.fasterxml.jackson.failing; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
|
||
import com.fasterxml.jackson.databind.BaseMapTest; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class IgnoredCreatorProperty1572Test extends BaseMapTest | ||
{ | ||
static class InnerTest | ||
{ | ||
public String str; | ||
public String otherStr; | ||
} | ||
|
||
static class OuterTest | ||
{ | ||
InnerTest inner; | ||
|
||
@JsonIgnore | ||
public String otherStr; | ||
|
||
@JsonCreator | ||
public OuterTest(@JsonProperty("inner") InnerTest inner, | ||
@JsonProperty("otherOtherStr") String otherStr) { | ||
this.inner = inner; | ||
} | ||
} | ||
|
||
/* | ||
/******************************************************** | ||
/* Test methods | ||
/******************************************************** | ||
*/ | ||
|
||
private final ObjectMapper MAPPER = new ObjectMapper(); | ||
|
||
// [databind#1572] | ||
public void testIgnoredCtorParam() throws Exception | ||
{ | ||
String JSON = aposToQuotes("{'innerTest': {\n" | ||
+"'str':'str',\n" | ||
+"'otherStr': 'otherStr'\n" | ||
+"}}\n"); | ||
OuterTest result = MAPPER.readValue(JSON, OuterTest.class); | ||
assertNotNull(result); | ||
} | ||
} |
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