|
11 | 11 | import tools.jackson.databind.*;
|
12 | 12 | import tools.jackson.databind.annotation.JsonDeserialize;
|
13 | 13 | import tools.jackson.databind.annotation.JsonSerialize;
|
14 |
| -import tools.jackson.databind.exc.InvalidDefinitionException; |
15 | 14 | import tools.jackson.databind.exc.InvalidFormatException;
|
16 | 15 | import tools.jackson.databind.exc.UnrecognizedPropertyException;
|
17 | 16 | import tools.jackson.databind.util.StdConverter;
|
@@ -248,25 +247,10 @@ public void testIssue11() throws Exception
|
248 | 247 |
|
249 | 248 | // And one more: this time with a minor twist
|
250 | 249 | final Object plaino = new Object();
|
251 |
| - // first, a failed attempt: |
252 |
| - try { |
253 |
| - m = MAPPER.convertValue(plaino, Map.class); |
254 |
| - fail("Conversion should have failed"); |
255 |
| - } catch (InvalidDefinitionException e) { |
256 |
| - verifyException(e, "no properties discovered"); |
257 |
| - } |
258 |
| - |
259 |
| - ObjectMapper mapper = jsonMapperBuilder() |
260 |
| - .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) |
261 |
| - .build(); |
262 |
| - try { |
263 |
| - assertEquals("{}", mapper.writer() |
264 |
| - .writeValueAsString(plaino)); |
265 |
| - } catch (Exception e) { |
266 |
| - throw (Exception) e.getCause(); |
267 |
| - } |
| 250 | + assertEquals("{}", MAPPER.writer() |
| 251 | + .writeValueAsString(plaino)); |
268 | 252 | // should now work, via serialization/deserialization:
|
269 |
| - m = mapper.convertValue(plaino, Map.class); |
| 253 | + m = MAPPER.convertValue(plaino, Map.class); |
270 | 254 | assertNotNull(m);
|
271 | 255 | assertEquals(0, m.size());
|
272 | 256 | }
|
|
0 commit comments