-
-
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.
- Loading branch information
1 parent
a546263
commit 5f1039f
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/test/java/com/fasterxml/jackson/failing/ReadOnly1345Test.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.failing; | ||
|
||
import java.beans.ConstructorProperties; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.*; | ||
|
||
public class ReadOnly1345Test extends BaseMapTest | ||
{ | ||
static class Foo1345 { | ||
@JsonProperty(access=JsonProperty.Access.READ_ONLY) | ||
public String id; | ||
public String name; | ||
|
||
@ConstructorProperties({ "id", "name" }) | ||
public Foo1345(String id, String name) { | ||
this.id = id; | ||
this.name = name; | ||
} | ||
} | ||
|
||
public void testReadOnly1345() throws Exception | ||
{ | ||
ObjectMapper mapper = new ObjectMapper(); | ||
Foo1345 result = mapper.readValue("{\"name\":\"test\"}", Foo1345.class); | ||
assertNotNull(result); | ||
assertEquals("test", result.name); | ||
} | ||
} |