Skip to content

Commit

Permalink
Add failing test for #1345
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 30, 2017
1 parent a546263 commit 5f1039f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/test/java/com/fasterxml/jackson/failing/ReadOnly1345Test.java
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);
}
}

0 comments on commit 5f1039f

Please sign in to comment.