Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ private void _testListSerialization(boolean useWrapping) throws Exception

// System.err.println("XML -> "+xmlMapper.writerWithDefaultPrettyPrinter().writeValueAsString(ob));

assertTrue(ob instanceof List);
List<?> resultList = (List<?>) ob;
List<?> resultList = assertInstanceOf(List.class, ob);
assertEquals(2, resultList.size());
assertEquals(SampleResource.class, resultList.get(0).getClass());
assertEquals(SampleResource.class, resultList.get(1).getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ public void testAnySetterNestedElementsRoundTrip() throws Exception

Object unmapped = pojo.others.get("unmapped");
assertNotNull(unmapped, "unmapped should be captured by @JsonAnySetter");
assertTrue(unmapped instanceof Map, "Expected Map but got: " + unmapped.getClass());
@SuppressWarnings("unchecked")
Map<String, Object> nested = (Map<String, Object>) unmapped;
Map<String, Object> nested = (Map<String, Object>) assertInstanceOf(Map.class, unmapped);
assertEquals("1", nested.get("a"));
assertEquals("2", nested.get("b"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void accessToPrettyPrinter() {
.enable(SerializationFeature.INDENT_OUTPUT)
.build();
try (JsonGenerator g = indentingMapper.createGenerator(new StringWriter())) {
assertTrue(g.getPrettyPrinter() instanceof DefaultXmlPrettyPrinter);
assertInstanceOf(DefaultXmlPrettyPrinter.class, g.getPrettyPrinter());
_writeDoc(g);
}
}
Expand Down
Loading