- objectMapper.writeValue(writer, object);
- } catch (JsonProcessingException e) {
- // Some issue with json serialization, probably caused by a bug
+ try {
+ objectMapper.writeValue(writer, object);
+ } catch (JsonProcessingException e) {
+ // Some issue with json serialization, probably caused by a bug
+ throw new AssertionError(e);
+ }
+ writer.write(System.lineSeparator());
+ writer.flush();
+ } catch (IOException e) {