File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/test/java/com/faforever/client/game Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 6565import java .util .Set ;
6666import java .util .concurrent .CompletableFuture ;
6767import java .util .concurrent .ExecutorService ;
68+ import java .util .function .Supplier ;
6869
6970import static java .util .concurrent .CompletableFuture .completedFuture ;
7071import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -150,7 +151,7 @@ public class GameRunnerTest extends ServiceTest {
150151 @ Spy
151152 private NotificationPrefs notificationPrefs ;
152153 @ Captor
153- private ArgumentCaptor <SimpleTask <? >> simpleTaskCaptor ;
154+ private ArgumentCaptor <Supplier < CompletableFuture < Object > >> simpleTaskCaptor ;
154155
155156 @ Mock
156157 private EnterPasswordController enterPasswordController ;
@@ -201,9 +202,9 @@ private void mockStartGameProcess(GameLaunchResponse gameLaunchResponse) throws
201202 lenient ().when (iceAdapter .start (anyInt (), anyBoolean ())).thenReturn (completedFuture (GPG_PORT ));
202203 lenient ().when (coturnService .getIceSession (anyInt ()))
203204 .thenReturn (Mono .just (new IceSession ("someSessionId" , false , List .of ())));
204- lenient ().when (taskService .submitTask ( simpleTaskCaptor .capture ())).thenAnswer (_ -> {
205- SimpleTask <? > task = simpleTaskCaptor .getValue ();
206- task .getFuture (). join ();
205+ lenient ().when (taskService .submitFutureTask ( anyString (), simpleTaskCaptor .capture ())).thenAnswer (_ -> {
206+ CompletableFuture < Object > task = simpleTaskCaptor .getValue (). get ();
207+ task .join ();
207208 return task ;
208209 });
209210 lenient ().when (process .onExit ()).thenReturn (new CompletableFuture <>());
You can’t perform that action at this time.
0 commit comments