@@ -44,34 +44,31 @@ public final void givenDifferentAccessLevels_whenGetterAdded_thenSerializable()
44
44
final String dtoAsString = mapper .writeValueAsString (dtoObject );
45
45
assertThat (dtoAsString , containsString ("stringValue" ));
46
46
assertThat (dtoAsString , not (containsString ("intValue" )));
47
- assertThat (dtoAsString , containsString ("booleanValue" ));
48
47
System .out .println (dtoAsString );
49
48
}
50
49
51
50
@ Test
52
51
public final void givenDifferentAccessLevels_whenGetterAdded_thenDeserializable () throws JsonProcessingException , JsonMappingException , IOException {
53
- final String jsonAsString = "{\" stringValue\" :\" dtoString\" ,\" intValue \" :1, \" booleanValue\" :\" true\" }" ;
52
+ final String jsonAsString = "{\" stringValue\" :\" dtoString\" ,\" booleanValue\" :\" true\" }" ;
54
53
final ObjectMapper mapper = new ObjectMapper ();
55
54
56
55
final MyDtoGetterImplicitDeserialization dtoObject = mapper .readValue (jsonAsString , MyDtoGetterImplicitDeserialization .class );
57
56
58
57
assertNotNull (dtoObject );
59
58
assertThat (dtoObject .getStringValue (), equalTo ("dtoString" ));
60
- assertThat (dtoObject .getIntValue (), equalTo (1 ));
61
59
assertThat (dtoObject .booleanValue , equalTo (true ));
62
60
}
63
61
64
62
@ Test
65
63
public final void givenDifferentAccessLevels_whenSetterAdded_thenDeserializable () throws JsonProcessingException , JsonMappingException , IOException {
66
- final String jsonAsString = "{\" stringValue\" :\" dtoString\" ,\" intValue\" :1, \" booleanValue \" : \" true \" }" ;
64
+ final String jsonAsString = "{\" stringValue\" :\" dtoString\" ,\" intValue\" :1}" ;
67
65
final ObjectMapper mapper = new ObjectMapper ();
68
66
69
67
final MyDtoSetter dtoObject = mapper .readValue (jsonAsString , MyDtoSetter .class );
70
68
71
69
assertNotNull (dtoObject );
72
70
assertThat (dtoObject .getStringValue (), equalTo ("dtoString" ));
73
71
assertThat (dtoObject .anotherGetIntValue (), equalTo (1 ));
74
- assertThat (dtoObject .booleanValue , equalTo (true ));
75
72
}
76
73
77
74
@ Test
@@ -83,7 +80,6 @@ public final void givenDifferentAccessLevels_whenSetterAdded_thenStillNotSeriali
83
80
final String dtoAsString = mapper .writeValueAsString (dtoObject );
84
81
assertThat (dtoAsString , containsString ("stringValue" ));
85
82
assertThat (dtoAsString , not (containsString ("intValue" )));
86
- assertThat (dtoAsString , containsString ("booleanValue" ));
87
83
System .out .println (dtoAsString );
88
84
}
89
85
0 commit comments