JacksonSerializer implements JsonSerializer { public <T> void serialize(Writer w, T value) throws IOException { objectMapper.writeValue(w, value); }  @PostConstruct JacksonSerializer init(); void serialize(Writer w, T value);  }
@Test public void shouldSerializeGameLogs() throws IOException { jacksonSerializer.serialize(writer, new GameLogData(Arrays.asList("file1", "file2"))); JsonPath jsonPath = from(writer.toString()); List<List> dataList = jsonPath.getList("aaData"); assertEquals("file1", getCell(dataList, 0, 0)); assertEquals("file2", getCell(dataList, 1, 0)); }
@Test public void shouldSerializeScores() throws IOException { jacksonSerializer.serialize(writer, new ScoresData(Arrays.asList(new Score("vasya", 1, null, "123", 11), new Score("petya", 2, null, "321", 22)))); JsonPath jsonPath = from(writer.toString()); List<List> dataList = jsonPath.getList("aaData"); assertScoreRow(dataList, 0, "vasya", 1, "123"); assertScoreRow(dataList, 1, "petya", 2, "321"); }