-
-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
3010de7
commit 9e72a25
Showing
2 changed files
with
37 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
32 changes: 32 additions & 0 deletions
32
...m/fasterxml/jackson/databind/introspect/IgnoredFieldPresentInCreatorProperty2001Test.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.introspect; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.BaseMapTest; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.junit.Test; | ||
|
||
import java.beans.ConstructorProperties; | ||
import java.io.IOException; | ||
|
||
// Tests for [databind#2001] | ||
public class IgnoredFieldPresentInCreatorProperty2001Test extends BaseMapTest { | ||
|
||
static public class Foo { | ||
|
||
@JsonIgnore | ||
public String query; | ||
|
||
@JsonCreator | ||
@ConstructorProperties("rawQuery") | ||
public Foo(@JsonProperty("query") String rawQuery) { | ||
query = rawQuery; | ||
} | ||
} | ||
|
||
public void testIgnoredFieldPresentInPropertyCreator() throws IOException { | ||
Foo deserialized = new ObjectMapper().readValue("{\"query\": \"bar\"}", Foo.class); | ||
assertEquals("bar", deserialized.query); | ||
} | ||
} |