Skip to content

Commit 5f1039f

Browse files
committed
Add failing test for #1345
1 parent a546263 commit 5f1039f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import java.beans.ConstructorProperties;
4+
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
import com.fasterxml.jackson.databind.*;
7+
8+
public class ReadOnly1345Test extends BaseMapTest
9+
{
10+
static class Foo1345 {
11+
@JsonProperty(access=JsonProperty.Access.READ_ONLY)
12+
public String id;
13+
public String name;
14+
15+
@ConstructorProperties({ "id", "name" })
16+
public Foo1345(String id, String name) {
17+
this.id = id;
18+
this.name = name;
19+
}
20+
}
21+
22+
public void testReadOnly1345() throws Exception
23+
{
24+
ObjectMapper mapper = new ObjectMapper();
25+
Foo1345 result = mapper.readValue("{\"name\":\"test\"}", Foo1345.class);
26+
assertNotNull(result);
27+
assertEquals("test", result.name);
28+
}
29+
}

0 commit comments

Comments
 (0)