File tree 1 file changed +29
-0
lines changed
src/test/java/com/fasterxml/jackson/failing
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments