diff --git a/README.md b/README.md index d954c3119..6e76f0d99 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager) [![GitHub last commit](https://img.shields.io/github/last-commit/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager) [![CircleCI](https://circleci.com/gh/softwaremagico/KendoTournamentManager.svg?style=shield)](https://circleci.com/gh/softwaremagico/KendoTournamentManager) -[![Time](https://img.shields.io/badge/development-637.5h-blueviolet.svg)]() +[![Time](https://img.shields.io/badge/development-639h-blueviolet.svg)]() [![Powered by](https://img.shields.io/badge/powered%20by%20java-orange.svg?logo=OpenJDK&logoColor=white)]() [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=kendo-tournament-backend&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=kendo-tournament-backend) diff --git a/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java b/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java index 999ded7e7..167f9bb72 100644 --- a/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java +++ b/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java @@ -109,7 +109,7 @@ private boolean getMaxGroupFights(Tournament tournament) { } } - return false; + return true; } diff --git a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTest.java b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTest.java index ec85626a4..ec667f86f 100644 --- a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTest.java +++ b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTest.java @@ -35,6 +35,7 @@ import com.softwaremagico.kt.core.controller.models.RoleDTO; import com.softwaremagico.kt.core.controller.models.TeamDTO; import com.softwaremagico.kt.core.controller.models.TournamentDTO; +import com.softwaremagico.kt.core.controller.models.TournamentExtraPropertyDTO; import com.softwaremagico.kt.core.converters.FightConverter; import com.softwaremagico.kt.core.converters.TournamentConverter; import com.softwaremagico.kt.core.converters.models.FightConverterRequest; @@ -132,6 +133,7 @@ public void addTournament() { TournamentDTO newTournament = new TournamentDTO(TOURNAMENT_NAME, 1, MEMBERS, TournamentType.TREE); tournamentDTO = tournamentController.create(newTournament, null); tournamentExtraPropertyProvider.save(new TournamentExtraProperty(tournamentConverter.reverse(tournamentDTO), TournamentExtraPropertyKey.ODD_FIGHTS_RESOLVED_ASAP, "false")); + tournamentExtraPropertyProvider.save(new TournamentExtraProperty(tournamentConverter.reverse(tournamentDTO), TournamentExtraPropertyKey.MAXIMIZE_FIGHTS, "false")); Assert.assertEquals(tournamentController.count(), 1); } diff --git a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTwoWinnersTest.java b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTwoWinnersTest.java index 5838e2e11..9e5a71ef9 100644 --- a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTwoWinnersTest.java +++ b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/Tournament5GroupsTwoWinnersTest.java @@ -149,6 +149,7 @@ public void addTournament() { TournamentDTO newTournament = new TournamentDTO(TOURNAMENT_NAME, 1, MEMBERS, TournamentType.TREE); tournamentDTO = tournamentController.create(newTournament, null); tournamentExtraPropertyProvider.save(new TournamentExtraProperty(tournamentConverter.reverse(tournamentDTO), TournamentExtraPropertyKey.ODD_FIGHTS_RESOLVED_ASAP, "false")); + tournamentExtraPropertyProvider.save(new TournamentExtraProperty(tournamentConverter.reverse(tournamentDTO), TournamentExtraPropertyKey.MAXIMIZE_FIGHTS, "false")); Assert.assertEquals(tournamentController.count(), 1); tournamentExtraPropertyController.create(new TournamentExtraPropertyDTO(tournamentDTO, TournamentExtraPropertyKey.NUMBER_OF_WINNERS, "2"), null); diff --git a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentLevelNotFinishedTest.java b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentLevelNotFinishedTest.java index b43c2e5d4..ea031adc2 100644 --- a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentLevelNotFinishedTest.java +++ b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentLevelNotFinishedTest.java @@ -24,21 +24,20 @@ import com.softwaremagico.kt.core.controller.ClubController; import com.softwaremagico.kt.core.controller.DuelController; import com.softwaremagico.kt.core.controller.FightController; -import com.softwaremagico.kt.core.controller.FightStatisticsController; import com.softwaremagico.kt.core.controller.GroupController; import com.softwaremagico.kt.core.controller.ParticipantController; import com.softwaremagico.kt.core.controller.RoleController; import com.softwaremagico.kt.core.controller.TeamController; import com.softwaremagico.kt.core.controller.TournamentController; +import com.softwaremagico.kt.core.controller.TournamentExtraPropertyController; import com.softwaremagico.kt.core.controller.models.ClubDTO; import com.softwaremagico.kt.core.controller.models.GroupDTO; import com.softwaremagico.kt.core.controller.models.ParticipantDTO; import com.softwaremagico.kt.core.controller.models.RoleDTO; import com.softwaremagico.kt.core.controller.models.TeamDTO; import com.softwaremagico.kt.core.controller.models.TournamentDTO; +import com.softwaremagico.kt.core.controller.models.TournamentExtraPropertyDTO; import com.softwaremagico.kt.core.converters.FightConverter; -import com.softwaremagico.kt.core.converters.GroupConverter; -import com.softwaremagico.kt.core.converters.TeamConverter; import com.softwaremagico.kt.core.converters.TournamentConverter; import com.softwaremagico.kt.core.converters.models.FightConverterRequest; import com.softwaremagico.kt.core.exceptions.LevelNotFinishedException; @@ -49,6 +48,7 @@ import com.softwaremagico.kt.persistence.entities.Group; import com.softwaremagico.kt.persistence.values.RoleType; import com.softwaremagico.kt.persistence.values.Score; +import com.softwaremagico.kt.persistence.values.TournamentExtraPropertyKey; import com.softwaremagico.kt.persistence.values.TournamentType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -93,18 +93,9 @@ public class TournamentLevelNotFinishedTest extends AbstractTestNGSpringContextT @Autowired private ClubController clubController; - @Autowired - private GroupConverter groupConverter; - - @Autowired - private TeamConverter teamConverter; - @Autowired private RankingProvider rankingProvider; - @Autowired - private FightStatisticsController fightStatisticsController; - @Autowired private GroupController groupController; @@ -117,6 +108,9 @@ public class TournamentLevelNotFinishedTest extends AbstractTestNGSpringContextT @Autowired private FightConverter fightConverter; + @Autowired + private TournamentExtraPropertyController tournamentExtraPropertyController; + private ClubDTO clubDTO; @@ -137,6 +131,8 @@ public void addTournament() { Assert.assertEquals(tournamentController.count(), 0); TournamentDTO newTournament = new TournamentDTO(TOURNAMENT_NAME, 1, MEMBERS, TournamentType.TREE); tournamentDTO = tournamentController.create(newTournament, null); + tournamentExtraPropertyController.create(new TournamentExtraPropertyDTO(tournamentDTO, + TournamentExtraPropertyKey.MAXIMIZE_FIGHTS, "false"), null); Assert.assertEquals(tournamentController.count(), 1); } diff --git a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTest.java b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTest.java index 396532259..c84bd9ae4 100644 --- a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTest.java +++ b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTest.java @@ -132,6 +132,7 @@ public void addTournament() { TournamentDTO newTournament = new TournamentDTO(TOURNAMENT_NAME, 1, MEMBERS, TournamentType.TREE); tournamentDTO = tournamentController.create(newTournament, null); tournamentExtraPropertyProvider.save(new TournamentExtraProperty(tournamentConverter.reverse(tournamentDTO), TournamentExtraPropertyKey.ODD_FIGHTS_RESOLVED_ASAP, "false")); + tournamentExtraPropertyProvider.save(new TournamentExtraProperty(tournamentConverter.reverse(tournamentDTO), TournamentExtraPropertyKey.MAXIMIZE_FIGHTS, "false")); Assert.assertEquals(tournamentController.count(), 1); } diff --git a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTwoWinnersTest.java b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTwoWinnersTest.java index 7d955819a..f8f58d0ed 100644 --- a/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTwoWinnersTest.java +++ b/backend/kendo-tournament-core/src/test/java/com/softwaremagico/kt/core/tests/tournament/TournamentTwoWinnersTest.java @@ -99,18 +99,9 @@ public class TournamentTwoWinnersTest extends AbstractTestNGSpringContextTests { @Autowired private ClubController clubController; - @Autowired - private GroupConverter groupConverter; - - @Autowired - private TeamConverter teamConverter; - @Autowired private RankingProvider rankingProvider; - @Autowired - private FightStatisticsController fightStatisticsController; - @Autowired private GroupController groupController; @@ -143,6 +134,8 @@ public void addTournament() { Assert.assertEquals(tournamentController.count(), 0); TournamentDTO newTournament = new TournamentDTO(TOURNAMENT_NAME, 1, MEMBERS, TournamentType.TREE); tournamentDTO = tournamentController.create(newTournament, null); + tournamentExtraPropertyController.create(new TournamentExtraPropertyDTO(tournamentDTO, + TournamentExtraPropertyKey.MAXIMIZE_FIGHTS, "false"), null); Assert.assertEquals(tournamentController.count(), 1); tournamentExtraPropertyController.create(new TournamentExtraPropertyDTO(tournamentDTO, TournamentExtraPropertyKey.NUMBER_OF_WINNERS, "2"), null);