fix: update tests

This commit is contained in:
punchready 2021-07-06 13:15:15 +02:00
parent 8f12084308
commit 8c8a4752e3
3 changed files with 5 additions and 5 deletions

View File

@ -64,7 +64,7 @@ class LobbyTest {
doNothing().when(lobby).updateTurnTimer(); doNothing().when(lobby).updateTurnTimer();
Participant playerOne = new Participant( Participant playerOne = new Participant(
new Client(playerConnection), "LobbyOne", ParticipantType.PlayerOne); new Client(playerConnection), "LobbyOne", ParticipantType.PlayerOne, false);
lobby.receiveRequests(requests, playerOne); lobby.receiveRequests(requests, playerOne);
} }
@ -80,7 +80,7 @@ class LobbyTest {
@Disabled @Disabled
void generateWinPlayer1Test(){ void generateWinPlayer1Test(){
var webSoc = mock(WebSocket.class); 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); lobby.triggerWin(winner);
verify(connection).broadcastEvents( verify(connection).broadcastEvents(
new EventBuilder(EventType.WinEvent) new EventBuilder(EventType.WinEvent)
@ -95,7 +95,7 @@ class LobbyTest {
@Disabled @Disabled
void generateWinPlayer2Test(){ void generateWinPlayer2Test(){
var webSoc = mock(WebSocket.class); 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); lobby.triggerWin(winner);
verify(connection).broadcastEvents( verify(connection).broadcastEvents(
new EventBuilder(EventType.WinEvent) new EventBuilder(EventType.WinEvent)

View File

@ -24,7 +24,7 @@ class TurnTimeoutTimerTest {
@Test @Test
void startTurnTimerTest(){ void startTurnTimerTest(){
var connection = mock(WebSocket.class); 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)); assertThatIllegalStateException().describedAs("Spectators don't have TurnTime").isThrownBy(() -> turnTimeoutTimer.startTurnTimer(participant));
} }

View File

@ -48,7 +48,7 @@ class PacketTest {
new RequestBuilder(RequestType.Req).buildGameRequest(), new RequestBuilder(RequestType.Req).buildGameRequest(),
new RequestBuilder(RequestType.MoveRequest).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); packet = new Packet(requests, participant);
assertThat(packet.getOrigin()).isEqualTo(participant); assertThat(packet.getOrigin()).isEqualTo(participant);