diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java index c8d0933..280e346 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java @@ -92,11 +92,11 @@ public class Lobby { badRequests = 0; } - updateTimer(game.state.getActiveCharacter().type); - + updateTimer(); } - void updateTimer(EntityType currentActiveCharacterType) { + void updateTimer() { + var currentActiveCharacterType = game.state.getActiveCharacter().type; if (pauseSegment.isPaused()) { turnTimer.clear(); } else if (currentActiveCharacterType == EntityType.P1) { diff --git a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/LobbyTest.java b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/LobbyTest.java index ba9ce42..73eb330 100644 --- a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/LobbyTest.java +++ b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/LobbyTest.java @@ -35,13 +35,13 @@ class LobbyTest { }; var characterConfig = mock(CharacterConfig.class); - lobby = new Lobby( + lobby = spy(new Lobby( gameID, connection, partyConfig, characterConfig, scenarioConfig - ); + )); } @Test @@ -51,9 +51,10 @@ class LobbyTest { new RequestBuilder(RequestType.MoveRequest).buildGameRequest() }; var playerConnection = mock(WebSocket.class); + doNothing().when(lobby).updateTimer(); Participant playerOne = new Participant(playerConnection, ParticipantType.PlayerOne, "P1"); lobby.receiveRequests(requests, playerOne); } -} \ No newline at end of file +}