@@ -157,44 +157,45 @@ public void testSerOptDefault() throws Exception {
157
157
assertEquals ("{\" myString\" :null}" , value );
158
158
}
159
159
160
- public void testSerOptNull () throws Exception {
161
- OptionalData data = new OptionalData ();
162
- data .myString = null ;
163
- String value = mapperWithModule ().setSerializationInclusion (
164
- JsonInclude .Include .NON_NULL ).writeValueAsString (data );
165
- assertEquals ("{}" , value );
166
- }
160
+ public void testSerOptNull () throws Exception {
161
+ OptionalData data = new OptionalData ();
162
+ data .myString = null ;
163
+ String value = mapperWithModule ().setSerializationInclusion (
164
+ JsonInclude .Include .NON_NULL ).writeValueAsString (data );
165
+ assertEquals ("{}" , value );
166
+ }
167
167
168
- public void testSerOptDisableAsNull () throws Exception {
169
- final OptionalData data = new OptionalData ();
170
- data .myString = Optional .empty ();
168
+ @ SuppressWarnings ("deprecation" )
169
+ public void testSerOptDisableAsNull () throws Exception {
170
+ final OptionalData data = new OptionalData ();
171
+ data .myString = Optional .empty ();
171
172
172
- Jdk8Module mod = new Jdk8Module ().configureAbsentsAsNulls (false );
173
- ObjectMapper mapper = new ObjectMapper ().registerModule (mod )
174
- .setSerializationInclusion (JsonInclude .Include .NON_NULL );
173
+ Jdk8Module mod = new Jdk8Module ().configureAbsentsAsNulls (false );
174
+ ObjectMapper mapper = new ObjectMapper ().registerModule (mod )
175
+ .setSerializationInclusion (JsonInclude .Include .NON_NULL );
175
176
176
- assertEquals ("{\" myString\" :null}" , mapper .writeValueAsString (data ));
177
+ assertEquals ("{\" myString\" :null}" , mapper .writeValueAsString (data ));
177
178
178
- // but do exclude with NON_EMPTY
179
- mapper = new ObjectMapper ().registerModule (mod )
180
- .setSerializationInclusion (JsonInclude .Include .NON_EMPTY );
181
- assertEquals ("{}" , mapper .writeValueAsString (data ));
179
+ // but do exclude with NON_EMPTY
180
+ mapper = new ObjectMapper ().registerModule (mod )
181
+ .setSerializationInclusion (JsonInclude .Include .NON_EMPTY );
182
+ assertEquals ("{}" , mapper .writeValueAsString (data ));
182
183
183
- // and with new (2.6) NON_ABSENT
184
- mapper = new ObjectMapper ().registerModule (mod )
185
- .setSerializationInclusion (JsonInclude .Include .NON_ABSENT );
186
- assertEquals ("{}" , mapper .writeValueAsString (data ));
187
- }
184
+ // and with new (2.6) NON_ABSENT
185
+ mapper = new ObjectMapper ().registerModule (mod )
186
+ .setSerializationInclusion (JsonInclude .Include .NON_ABSENT );
187
+ assertEquals ("{}" , mapper .writeValueAsString (data ));
188
+ }
188
189
189
- public void testSerOptNonEmpty () throws Exception {
190
- OptionalData data = new OptionalData ();
191
- data .myString = null ;
192
- String value = mapperWithModule ().setSerializationInclusion (
193
- JsonInclude .Include .NON_EMPTY ).writeValueAsString (data );
194
- assertEquals ("{}" , value );
195
- }
190
+ public void testSerOptNonEmpty () throws Exception {
191
+ OptionalData data = new OptionalData ();
192
+ data .myString = null ;
193
+ String value = mapperWithModule ().setSerializationInclusion (
194
+ JsonInclude .Include .NON_EMPTY ).writeValueAsString (data );
195
+ assertEquals ("{}" , value );
196
+ }
196
197
197
- public void testWithTypingEnabled () throws Exception {
198
+ public void testWithTypingEnabled () throws Exception {
198
199
final ObjectMapper objectMapper = mapperWithModule ();
199
200
// ENABLE TYPING
200
201
objectMapper .activateDefaultTyping (new NoCheckSubTypeValidator (),
0 commit comments