From e88ebd8d5b2b4fbcaea0f6b4dc7db7bbe2247511 Mon Sep 17 00:00:00 2001 From: Roberto Negro Date: Fri, 23 Feb 2024 19:45:02 +0100 Subject: [PATCH] Commit pre pull quinta release --- .../eclipse/controller/EventController.java | 34 ++++++++++++++++++- .../maven/eclipse/service/GameRepository.java | 2 +- .../maven/eclipse/states/GameState.java | 2 +- .../maven/eclipse/states/GameStateTest.java | 2 +- .../maven/eclipse/states/LobbyStateTest.java | 1 - 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/mvcguru/risiko/maven/eclipse/controller/EventController.java b/src/main/java/com/mvcguru/risiko/maven/eclipse/controller/EventController.java index c0c647f..fcce2f5 100644 --- a/src/main/java/com/mvcguru/risiko/maven/eclipse/controller/EventController.java +++ b/src/main/java/com/mvcguru/risiko/maven/eclipse/controller/EventController.java @@ -54,7 +54,39 @@ public void enterInTheGame(@Payload PlayerBody body, @DestinationVariable String IGame game = null; try { game = GameRepository.getInstance().getCompletedGame(id); - Player player = Player.builder().userName(body.getUsername()).gameId(id).territories(new ArrayList()).color(Player.PlayerColor.GREY).build(); + Player player = Player. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ().userName(body.getUsername()).gameId(id).territories(new ArrayList()).color(Player.PlayerColor.GREY).build(); GameEntry action = GameEntry.builder().player(player).build(); GameRepository.getInstance().addPlayer(player); game.onActionPlayer(action); diff --git a/src/main/java/com/mvcguru/risiko/maven/eclipse/service/GameRepository.java b/src/main/java/com/mvcguru/risiko/maven/eclipse/service/GameRepository.java index f04beb8..65bb2fe 100644 --- a/src/main/java/com/mvcguru/risiko/maven/eclipse/service/GameRepository.java +++ b/src/main/java/com/mvcguru/risiko/maven/eclipse/service/GameRepository.java @@ -137,7 +137,7 @@ public synchronized void updateTerritoryOwner(String territoryName, Player playe } public synchronized void updateTerritoryArmies(String territoryName, String gameId, int armies) throws GameException { db.updateTerritoryArmies(territoryName, gameId, armies); - } + } //TurnDao diff --git a/src/main/java/com/mvcguru/risiko/maven/eclipse/states/GameState.java b/src/main/java/com/mvcguru/risiko/maven/eclipse/states/GameState.java index b32cf8b..b53bc1b 100644 --- a/src/main/java/com/mvcguru/risiko/maven/eclipse/states/GameState.java +++ b/src/main/java/com/mvcguru/risiko/maven/eclipse/states/GameState.java @@ -1,4 +1,4 @@ -package com.mvcguru.risiko.maven.eclipse.states; +gotpackage com.mvcguru.risiko.maven.eclipse.states; import java.io.IOException; import java.io.Serializable; diff --git a/src/test/java/com/mvcguru/risiko/maven/eclipse/states/GameStateTest.java b/src/test/java/com/mvcguru/risiko/maven/eclipse/states/GameStateTest.java index e23451e..e04f51a 100644 --- a/src/test/java/com/mvcguru/risiko/maven/eclipse/states/GameStateTest.java +++ b/src/test/java/com/mvcguru/risiko/maven/eclipse/states/GameStateTest.java @@ -15,7 +15,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; - + class GameStateTest { @Mock diff --git a/src/test/java/com/mvcguru/risiko/maven/eclipse/states/LobbyStateTest.java b/src/test/java/com/mvcguru/risiko/maven/eclipse/states/LobbyStateTest.java index 4f534ae..8c95f77 100644 --- a/src/test/java/com/mvcguru/risiko/maven/eclipse/states/LobbyStateTest.java +++ b/src/test/java/com/mvcguru/risiko/maven/eclipse/states/LobbyStateTest.java @@ -184,7 +184,6 @@ void totalGameLogic() throws IOException, GameException, DatabaseConnectionExcep TerritorySetup territorySetup3 = TerritorySetup.builder().player(player1).setUpBody(setUpBody3).build(); game.getState().onActionPlayer(territorySetup3); - assertEquals(game.getState().getClass().toString(), BattleState.class.toString()); }