use of com.faforever.commons.replay.ReplayData in project downlords-faf-client by FAForever.
the class ReplayServiceImplTest method testEnrich.
@Test
public void testEnrich() throws Exception {
Path path = Paths.get("foo.bar");
when(replayFileReader.parseReplay(path)).thenReturn(new ReplayData(emptyList(), emptyList()));
instance.enrich(new Replay(), path);
verify(replayFileReader).parseReplay(path);
}
use of com.faforever.commons.replay.ReplayData in project downlords-faf-client by FAForever.
the class ReplayServiceImpl method enrich.
@Override
public void enrich(Replay replay, Path path) {
ReplayData replayData = replayFileReader.parseReplay(path);
replay.getChatMessages().setAll(replayData.getChatMessages().stream().map(chatMessage -> new ChatMessage(chatMessage.getTime(), chatMessage.getSender(), chatMessage.getMessage())).collect(Collectors.toList()));
replay.getGameOptions().setAll(replayData.getGameOptions().stream().map(gameOption -> new GameOption(gameOption.getKey(), gameOption.getValue())).collect(Collectors.toList()));
}
Aggregations