diff --git a/src/main/java/org/blondin/mpg/Main.java b/src/main/java/org/blondin/mpg/Main.java index dfcd460..b24f772 100644 --- a/src/main/java/org/blondin/mpg/Main.java +++ b/src/main/java/org/blondin/mpg/Main.java @@ -220,8 +220,8 @@ static void processGames(League league, ApiClients apiClients, Config config) { ChampionshipTypeWrapper.toStats(league.getChampionship()), config, false, false); Integer currentPlayersBuy = team.getBids().stream().map(Player::getPricePaid).collect(Collectors.summingInt(Integer::intValue)); - writeTransactionsProposal(playersTeam, playersAvailable, team.getBudget() - currentPlayersBuy, apiClients.getOutPlayers(), - ChampionshipTypeWrapper.toOut(league.getChampionship()), config); + writeTransactionsProposal(cd.getDay(), playersTeam, playersAvailable, team.getBudget() - currentPlayersBuy, + apiClients.getOutPlayers(), ChampionshipTypeWrapper.toOut(league.getChampionship()), config); } } } catch (NoMoreGamesException e) { @@ -303,7 +303,7 @@ private static void updateTeamWithRetry(MpgClient mpgClient, Division division, } } - private static void writeTransactionsProposal(List playersTeam, List playersAvailable, int budget, + private static void writeTransactionsProposal(int currentDay, List playersTeam, List playersAvailable, int budget, InjuredSuspendedWrapperClient outPlayersClient, ChampionshipOutType championship, Config config) { // Players with bad efficiency @@ -319,7 +319,7 @@ private static void writeTransactionsProposal(List playersTeam, List 2 && !players2Sell.isEmpty()) { LOG.info("Players to sell (initial cash: {}):", budget); AsciiTable at = getTable(TABLE_POSITION, TABLE_PLAYER_NAME, TABLE_EFFICIENCY, TABLE_QUOTE); for (Player player : players2Sell) { diff --git a/src/main/java/org/blondin/mpg/stats/model/CurrentDay.java b/src/main/java/org/blondin/mpg/stats/model/CurrentDay.java index 4059892..fae1ce7 100644 --- a/src/main/java/org/blondin/mpg/stats/model/CurrentDay.java +++ b/src/main/java/org/blondin/mpg/stats/model/CurrentDay.java @@ -12,6 +12,10 @@ public class CurrentDay { @JsonProperty("lD") private int lastDayReached; + public int getDay() { + return day; + } + public int getDayReached() { return lastDayReached; } diff --git a/src/test/java/org/blondin/mpg/MainTest.java b/src/test/java/org/blondin/mpg/MainTest.java index 0507798..157970d 100644 --- a/src/test/java/org/blondin/mpg/MainTest.java +++ b/src/test/java/org/blondin/mpg/MainTest.java @@ -438,8 +438,10 @@ public void testProcessFromEmptyCoach() throws Exception { Assert.assertTrue(getLogOut(), getLogOut().contains("Ligue 2 Fous")); Assert.assertTrue(getLogOut(), getLogOut().contains("Ba")); Assert.assertTrue(getLogOut(), getLogOut().contains("Updating team")); - Assert.assertTrue(getLogOut(), getLogOut().contains("Transactions proposal")); Assert.assertTrue(getLogOut(), getLogOut().contains("| G | Prevot Maxence (mpg_championship_player_220359) | 4.00 |")); + Assert.assertTrue(getLogOut(), getLogOut().contains("Transactions proposal")); + // currentGameWeek is 2 => selling players should not be displayed + Assert.assertFalse(getLogOut(), getLogOut().contains("Players to sell (initial cash")); } private void executeMainProcess(Config config) {