Skip to content

Commit

Permalink
Merge pull request #3505 from ingef/feature/serdes-test-better-feedba…
Browse files Browse the repository at this point in the history
…ck-on-mapper

catches serdes error for specific mapper and prints its view
  • Loading branch information
thoniTUB authored Jul 30, 2024
2 parents 3667d79 + ea0c065 commit 94f07e4
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@ public void test(T value, T expected) throws JSONException, IOException {
}

for (ObjectMapper objectMapper : objectMappers) {
test(
value,
expected,
objectMapper
);
try {
test(
value,
expected,
objectMapper
);
} catch (Exception e) {
Class<?> activeView = objectMapper.getSerializationConfig().getActiveView();
throw new IllegalStateException("Serdes failed with object mapper using view '" + activeView + "'", e);
}
}
}

Expand Down

0 comments on commit 94f07e4

Please sign in to comment.