diff --git a/src/test/java/com/faforever/client/game/GameServiceTest.java b/src/test/java/com/faforever/client/game/GameServiceTest.java index c2ea845f22..d079c64503 100644 --- a/src/test/java/com/faforever/client/game/GameServiceTest.java +++ b/src/test/java/com/faforever/client/game/GameServiceTest.java @@ -1088,13 +1088,24 @@ public void spawnReplayTerminationListenerTest() { @Test public void onKillNoticeStopsGame() throws Exception { + GameBean game = GameBeanBuilder.create().defaultValues().get(); GameLaunchResponse gameLaunchMessage = GameLaunchMessageBuilder.create().defaultValues().get(); mockStartGameProcess(gameMapper.map(gameLaunchMessage)); + when(mapService.isInstalled(game.getMapFolderName())).thenReturn(true); + when(fafServerAccessor.requestJoinGame(game.getId(), null)).thenReturn(completedFuture(gameLaunchMessage)); + when(gameUpdater.update(any(), any(), any(), any(), anyBoolean())).thenReturn(completedFuture(null)); + when(modService.getFeaturedMod(game.getFeaturedMod())).thenReturn(Mono.just(FeaturedModBeanBuilder.create() + .defaultValues() + .get())); when(process.isAlive()).thenReturn(true); NoticeInfo noticeMessage = new NoticeInfo("kill", null); + + CompletableFuture future = instance.joinGame(game, null).toCompletableFuture(); + future.join(); + testNoticePublisher.next(noticeMessage); verify(iceAdapter).onGameCloseRequested();