diff --git a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/GameStateSegmentTest.java b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/GameStateSegmentTest.java index e5412cd..f2dc4a0 100644 --- a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/GameStateSegmentTest.java +++ b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/GameStateSegmentTest.java @@ -26,6 +26,7 @@ class GameStateSegmentTest { @Test void processRequests() { var game = mock(GameInstance.class); + var request = new RequestBuilder(RequestType.DisconnectRequest).buildGameRequest(); var event = new EventBuilder(EventType.DisconnectEvent).buildGameEvent(); when(game.checkRequestsAndApply(any(Request.class))).thenReturn(Optional.of(List.of(event))); var abort = new AtomicBoolean(false); @@ -34,7 +35,7 @@ class GameStateSegmentTest { // note that DisconnectRequests are actually never passed to the GameLogic, ever. var packet = new Packet( - new Request[] {new RequestBuilder(RequestType.DisconnectRequest).buildGameRequest()}, + new Request[] {request}, null); var carrier = new ArrayList(1); @@ -42,7 +43,7 @@ class GameStateSegmentTest { segment.processRequests(packet, carrier, abort); assertThat(carrier.contains(event)).isTrue(); - verify(game).checkRequestsAndApply(packet.get(0)); + verify(game).checkRequestsAndApply(request); assertThat(abort.get()).isFalse(); } }