From 8c8a4752e32255f75867c071ad66c85ea9cdfd4d Mon Sep 17 00:00:00 2001 From: punchready Date: Tue, 6 Jul 2021 13:15:15 +0200 Subject: [PATCH] fix: update tests --- .../uulm/teamname/marvelous/server/lobby/LobbyTest.java | 6 +++--- .../marvelous/server/lobby/TurnTimeoutTimerTest.java | 2 +- .../marvelous/server/lobby/pipelining/PacketTest.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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 7d37aec..6a4b62d 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 @@ -64,7 +64,7 @@ class LobbyTest { doNothing().when(lobby).updateTurnTimer(); Participant playerOne = new Participant( - new Client(playerConnection), "LobbyOne", ParticipantType.PlayerOne); + new Client(playerConnection), "LobbyOne", ParticipantType.PlayerOne, false); lobby.receiveRequests(requests, playerOne); } @@ -80,7 +80,7 @@ class LobbyTest { @Disabled void generateWinPlayer1Test(){ var webSoc = mock(WebSocket.class); - Participant winner = new Participant(new Client(webSoc), "someLobby", ParticipantType.PlayerOne); + Participant winner = new Participant(new Client(webSoc), "someLobby", ParticipantType.PlayerOne, false); lobby.triggerWin(winner); verify(connection).broadcastEvents( new EventBuilder(EventType.WinEvent) @@ -95,7 +95,7 @@ class LobbyTest { @Disabled void generateWinPlayer2Test(){ var webSoc = mock(WebSocket.class); - Participant winner = new Participant(new Client(webSoc), "someLobby", ParticipantType.PlayerOne); + Participant winner = new Participant(new Client(webSoc), "someLobby", ParticipantType.PlayerOne, false); lobby.triggerWin(winner); verify(connection).broadcastEvents( new EventBuilder(EventType.WinEvent) diff --git a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/TurnTimeoutTimerTest.java b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/TurnTimeoutTimerTest.java index 9343c54..d5db765 100644 --- a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/TurnTimeoutTimerTest.java +++ b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/TurnTimeoutTimerTest.java @@ -24,7 +24,7 @@ class TurnTimeoutTimerTest { @Test void startTurnTimerTest(){ var connection = mock(WebSocket.class); - var participant = new Participant(new Client(connection), "lobby", ParticipantType.Spectator); + var participant = new Participant(new Client(connection), "lobby", ParticipantType.Spectator, false); assertThatIllegalStateException().describedAs("Spectators don't have TurnTime").isThrownBy(() -> turnTimeoutTimer.startTurnTimer(participant)); } diff --git a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java index 53d67a9..ace112f 100644 --- a/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java +++ b/Server/src/test/java/uulm/teamname/marvelous/server/lobby/pipelining/PacketTest.java @@ -48,7 +48,7 @@ class PacketTest { new RequestBuilder(RequestType.Req).buildGameRequest(), new RequestBuilder(RequestType.MoveRequest).buildGameRequest() }; - var participant = new Participant(new Client(null), "SomeLobby", ParticipantType.PlayerOne); + var participant = new Participant(new Client(null), "SomeLobby", ParticipantType.PlayerOne, false); packet = new Packet(requests, participant); assertThat(packet.getOrigin()).isEqualTo(participant);