From 37af3f0585a5ae3af143f81c49a0d5d307dbd466 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 27 Nov 2026 22:38:13 +0000 Subject: [PATCH 1/5] Warn when top-voter awards require disabled leaderboard loading --- .../config/VotingPluginConfigHealth.java | 44 ++++++- .../TopVoterAwardConfigHealthTest.java | 122 ++++++++++++++++++ 2 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java diff --git a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java index 77d3977f66..d057e3f7d9 100644 --- a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java +++ b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java @@ -1,8 +1,14 @@ package com.bencodez.votingplugin.config; +import java.util.Set; +import java.util.function.Function; + +import org.bukkit.configuration.ConfigurationSection; + import com.bencodez.votingplugin.VotingPluginMain; +import com.bencodez.votingplugin.topvoter.TopVoter; -/** Owns aggregate YAML load-health reporting for VotingPlugin configuration files. */ +/** Reports configuration problems at startup and reload. */ public final class VotingPluginConfigHealth { private final VotingPluginMain plugin; @@ -13,14 +19,46 @@ public VotingPluginConfigHealth(VotingPluginMain plugin) { } public void check() { - ymlError = plugin.getConfigFile().isFailedToRead() || plugin.getConfigVoteSites().isFailedToRead() - || plugin.getSpecialRewardsConfig().isFailedToRead() || plugin.getBungeeSettings().isFailedToRead() + Config config = plugin.getConfigFile(); + SpecialRewardsConfig rewards = plugin.getSpecialRewardsConfig(); + boolean configReadFailed = config.isFailedToRead() || rewards.isFailedToRead(); + ymlError = configReadFailed || plugin.getConfigVoteSites().isFailedToRead() + || plugin.getBungeeSettings().isFailedToRead() || plugin.getGui().isFailedToRead(); if (ymlError) { plugin.getBukkitScheduler().runTaskLaterAsynchronously(plugin, () -> plugin.getLogger().severe("Failed to load a file, check startup log"), 1); } + if (!configReadFailed) { + if (rewards.isEnableMonthlyAwards() && !config.isLoadTopVoterMonthly()) { + warnIfAwardsConfigured(TopVoter.Monthly, rewards.getData(), rewards.getMonthlyPossibleRewardPlaces(), + rewards::getMonthlyAwardRewardsPath); + } + if (rewards.isEnableWeeklyAwards() && !config.isLoadTopVoterWeekly()) { + warnIfAwardsConfigured(TopVoter.Weekly, rewards.getData(), rewards.getWeeklyPossibleRewardPlaces(), + rewards::getWeeklyAwardRewardsPath); + } + if (rewards.isEnableDailyRewards() && !config.isLoadTopVoterDaily()) { + warnIfAwardsConfigured(TopVoter.Daily, rewards.getData(), rewards.getDailyPossibleRewardPlaces(), + rewards::getDailyAwardRewardsPath); + } + } + } + + private void warnIfAwardsConfigured(TopVoter period, ConfigurationSection data, Set places, + Function rewardPath) { + for (String place : places) { + String path = rewardPath.apply(place); + ConfigurationSection section = data.getConfigurationSection(path); + if ((section != null && !section.getKeys(false).isEmpty()) + || !data.getStringList(path).isEmpty() + || (data.isString(path) && !data.getString(path, "").isBlank())) { + plugin.getLogger().warning(period.name() + " top-voter awards are configured. Set LoadTopVoter." + + period.name() + " to true in Config.yml to load the rankings required for these awards."); + return; + } + } } public boolean hasYmlError() { diff --git a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java new file mode 100644 index 0000000000..35a81b5b0c --- /dev/null +++ b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java @@ -0,0 +1,122 @@ +package com.bencodez.votingplugin.tests.topvoter; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.mockito.ArgumentMatchers.contains; +import static org.mockito.Mockito.RETURNS_DEEP_STUBS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import java.io.File; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.logging.Logger; + +import org.bukkit.configuration.file.YamlConfiguration; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import com.bencodez.votingplugin.VotingPluginMain; +import com.bencodez.votingplugin.config.Config; +import com.bencodez.votingplugin.config.SpecialRewardsConfig; +import com.bencodez.votingplugin.config.VotingPluginConfigHealth; + +class TopVoterAwardConfigHealthTest { + + private final VotingPluginMain plugin = mock(VotingPluginMain.class, RETURNS_DEEP_STUBS); + private final Logger logger = mock(Logger.class); + private final YamlConfiguration configData = new YamlConfiguration(); + private final YamlConfiguration rewardData = new YamlConfiguration(); + private Config config; + private SpecialRewardsConfig rewards; + @TempDir + File dataFolder; + + @BeforeEach + void setUp() { + when(plugin.getDataFolder()).thenReturn(dataFolder); + config = new Config(plugin); + when(plugin.getConfigFile()).thenReturn(config); + rewards = new SpecialRewardsConfig(plugin); + when(plugin.getSpecialRewardsConfig()).thenReturn(rewards); + when(plugin.getLogger()).thenReturn(logger); + } + + @Test + void warnsOnceForMonthlyInlineAwards() { + configData.set("LoadTopVoter.Monthly", false); + rewardData.set("MonthlyAwards.1.Rewards.Messages.Player", "You won!"); + rewardData.set("MonthlyAwards.2.Rewards.Messages.Player", "You placed second!"); + + checkSingleWarning("Monthly"); + } + + @Test + void warnsForWeeklyAwardList() { + rewardData.set("EnableWeeklyAwards", true); + rewardData.set("WeeklyAwards.1.Rewards", List.of("example-reward")); + + checkSingleWarning("Weekly"); + } + + @Test + void warnsForDailyNamedAward() { + rewardData.set("EnableDailyRewards", true); + rewardData.set("DailyAwards.1.Rewards", "example-reward"); + + checkSingleWarning("Daily"); + } + + @Test + void ignoresPackagedDefaults() throws Exception { + check(loadDefaults("Config.yml"), loadDefaults("SpecialRewards.yml")); + + verifyNoInteractions(logger); + } + + @Test + void ignoresLoadedLeaderboardsAndAbsentOrEmptyRewards() { + configData.set("LoadTopVoter.Monthly", true); + rewardData.set("EnableMonthlyAwards", true); + rewardData.set("MonthlyAwards.1.Rewards.Messages.Player", "You won!"); + rewardData.set("EnableWeeklyAwards", true); + rewardData.createSection("WeeklyAwards.1.Rewards"); + rewardData.set("WeeklyAwards.2.Rewards", List.of()); + rewardData.set("WeeklyAwards.3.Rewards", ""); + rewardData.createSection("WeeklyAwards.4"); + rewardData.set("EnableDailyRewards", true); + + check(configData, rewardData); + + verifyNoInteractions(logger); + } + + private void check(YamlConfiguration configYaml, YamlConfiguration rewardsYaml) { + config.setData(configYaml); + config.loadValues(); + rewards.setData(rewardsYaml); + rewards.loadValues(); + VotingPluginConfigHealth health = new VotingPluginConfigHealth(plugin); + health.check(); + assertFalse(health.hasYmlError()); + } + + private void checkSingleWarning(String period) { + check(configData, rewardData); + verify(logger).warning(contains(period + " top-voter awards are configured. Set LoadTopVoter." + period)); + verifyNoMoreInteractions(logger); + } + + private static YamlConfiguration loadDefaults(String name) throws Exception { + try (var stream = TopVoterAwardConfigHealthTest.class.getClassLoader().getResourceAsStream(name); + var reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) { + var defaults = new YamlConfiguration(); + defaults.load(reader); + return defaults; + } + } +} From 23a5d734ca608d84aa84de9c923ad6a38795fe6f Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 27 Nov 2026 22:45:39 +0000 Subject: [PATCH 2/5] Limit top-voter warnings to awards that need leaderboard loading --- .../config/VotingPluginConfigHealth.java | 20 ++++++++++++++- .../TopVoterAwardConfigHealthTest.java | 25 ++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java index d057e3f7d9..c920110ea1 100644 --- a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java +++ b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java @@ -31,7 +31,8 @@ public void check() { () -> plugin.getLogger().severe("Failed to load a file, check startup log"), 1); } if (!configReadFailed) { - if (rewards.isEnableMonthlyAwards() && !config.isLoadTopVoterMonthly()) { + if (rewards.isEnableMonthlyAwards() && !config.isLoadTopVoterMonthly() + && !config.isUseMonthDateTotalsAsPrimaryTotal()) { warnIfAwardsConfigured(TopVoter.Monthly, rewards.getData(), rewards.getMonthlyPossibleRewardPlaces(), rewards::getMonthlyAwardRewardsPath); } @@ -49,6 +50,9 @@ public void check() { private void warnIfAwardsConfigured(TopVoter period, ConfigurationSection data, Set places, Function rewardPath) { for (String place : places) { + if (!includesPositiveRank(place)) { + continue; + } String path = rewardPath.apply(place); ConfigurationSection section = data.getConfigurationSection(path); if ((section != null && !section.getKeys(false).isEmpty()) @@ -61,6 +65,20 @@ private void warnIfAwardsConfigured(TopVoter period, ConfigurationSection data, } } + private static boolean includesPositiveRank(String place) { + // Match the end-exclusive ranges in TopVoterRanking without expanding them. + String[] bounds = place.split("-"); + if (bounds.length == 0) { + return false; + } + try { + int first = Integer.parseInt(bounds[0]); + return bounds.length == 1 ? first > 0 : Math.max(first, 1) < Integer.parseInt(bounds[1]); + } catch (NumberFormatException ignored) { + return false; + } + } + public boolean hasYmlError() { return ymlError; } diff --git a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java index 35a81b5b0c..cfecbd4704 100644 --- a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java +++ b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java @@ -58,7 +58,7 @@ void warnsOnceForMonthlyInlineAwards() { @Test void warnsForWeeklyAwardList() { rewardData.set("EnableWeeklyAwards", true); - rewardData.set("WeeklyAwards.1.Rewards", List.of("example-reward")); + rewardData.set("WeeklyAwards.1-2.Rewards", List.of("example-reward")); checkSingleWarning("Weekly"); } @@ -95,6 +95,29 @@ void ignoresLoadedLeaderboardsAndAbsentOrEmptyRewards() { verifyNoInteractions(logger); } + @Test + void ignoresMonthlyAwardsUsingDatedTotals() { + configData.set("LoadTopVoter.Monthly", false); + configData.set("UseMonthDateTotalsAsPrimaryTotal", true); + rewardData.set("MonthlyAwards.1.Rewards", "example-reward"); + + check(configData, rewardData); + + verifyNoInteractions(logger); + } + + @Test + void ignoresRewardsWithoutAnAwardableRank() { + rewardData.set("EnableWeeklyAwards", true); + rewardData.set("WeeklyAwards.2-2.Rewards", "example-reward"); + rewardData.set("WeeklyAwards.0.Rewards", "example-reward"); + rewardData.set("WeeklyAwards.invalid.Rewards", "example-reward"); + + check(configData, rewardData); + + verifyNoInteractions(logger); + } + private void check(YamlConfiguration configYaml, YamlConfiguration rewardsYaml) { config.setData(configYaml); config.loadValues(); From 968c3bec421ca454b0e35e2d3f58fe5954097e01 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 27 Nov 2026 22:52:44 +0000 Subject: [PATCH 3/5] Account for overlapping top-voter award ranks in configuration warnings --- .../config/VotingPluginConfigHealth.java | 53 ++++++++++++++----- .../TopVoterAwardConfigHealthTest.java | 22 ++++++++ 2 files changed, 63 insertions(+), 12 deletions(-) diff --git a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java index c920110ea1..11dd32d5dd 100644 --- a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java +++ b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java @@ -1,6 +1,8 @@ package com.bencodez.votingplugin.config; +import java.util.ArrayList; import java.util.Set; +import java.util.TreeMap; import java.util.function.Function; import org.bukkit.configuration.ConfigurationSection; @@ -49,36 +51,63 @@ public void check() { private void warnIfAwardsConfigured(TopVoter period, ConfigurationSection data, Set places, Function rewardPath) { - for (String place : places) { - if (!includesPositiveRank(place)) { + // Later entries win in TopVoterRanking. Track their covered ranks as merged ranges. + TreeMap coveredRanks = new TreeMap<>(); + for (String place : new ArrayList<>(places).reversed()) { + AwardRange range = positiveRankRange(place); + if (range == null) { continue; } - String path = rewardPath.apply(place); - ConfigurationSection section = data.getConfigurationSection(path); - if ((section != null && !section.getKeys(false).isEmpty()) - || !data.getStringList(path).isEmpty() - || (data.isString(path) && !data.getString(path, "").isBlank())) { + long start = range.start(); + long end = range.end(); + var previous = coveredRanks.floorEntry(start); + if (previous != null && previous.getValue() >= end) { + continue; + } + if (hasReward(data, rewardPath.apply(place))) { plugin.getLogger().warning(period.name() + " top-voter awards are configured. Set LoadTopVoter." + period.name() + " to true in Config.yml to load the rankings required for these awards."); return; } + if (previous != null && previous.getValue() >= start) { + start = previous.getKey(); + } + var next = coveredRanks.ceilingEntry(start); + while (next != null && next.getKey() <= end) { + end = Math.max(end, next.getValue()); + coveredRanks.remove(next.getKey()); + next = coveredRanks.ceilingEntry(start); + } + coveredRanks.put(start, end); } } - private static boolean includesPositiveRank(String place) { + private static boolean hasReward(ConfigurationSection data, String path) { + ConfigurationSection section = data.getConfigurationSection(path); + return (section != null && !section.getKeys(false).isEmpty()) + || data.getStringList(path).stream().anyMatch(name -> !name.isBlank()) + || (data.isString(path) && !data.getString(path, "").isBlank()); + } + + private static AwardRange positiveRankRange(String place) { // Match the end-exclusive ranges in TopVoterRanking without expanding them. String[] bounds = place.split("-"); if (bounds.length == 0) { - return false; + return null; } try { - int first = Integer.parseInt(bounds[0]); - return bounds.length == 1 ? first > 0 : Math.max(first, 1) < Integer.parseInt(bounds[1]); + int rank = Integer.parseInt(bounds[0]); + long start = Math.max(rank, 1); + long end = bounds.length == 1 ? (long) rank + 1 : Integer.parseInt(bounds[1]); + return start < end ? new AwardRange(start, end) : null; } catch (NumberFormatException ignored) { - return false; + return null; } } + private record AwardRange(long start, long end) { + } + public boolean hasYmlError() { return ymlError; } diff --git a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java index cfecbd4704..b9ccde20cf 100644 --- a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java +++ b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java @@ -88,6 +88,7 @@ void ignoresLoadedLeaderboardsAndAbsentOrEmptyRewards() { rewardData.set("WeeklyAwards.2.Rewards", List.of()); rewardData.set("WeeklyAwards.3.Rewards", ""); rewardData.createSection("WeeklyAwards.4"); + rewardData.set("WeeklyAwards.5.Rewards", List.of("")); rewardData.set("EnableDailyRewards", true); check(configData, rewardData); @@ -118,6 +119,27 @@ void ignoresRewardsWithoutAnAwardableRank() { verifyNoInteractions(logger); } + @Test + void ignoresRewardsWhenLaterEntriesCoverEveryRank() { + rewardData.set("EnableWeeklyAwards", true); + rewardData.set("WeeklyAwards.1-4.Rewards", "example-reward"); + rewardData.set("WeeklyAwards.1.Rewards", List.of()); + rewardData.set("WeeklyAwards.2-4.Rewards", List.of("")); + + check(configData, rewardData); + + verifyNoInteractions(logger); + } + + @Test + void warnsWhenLaterEntriesLeaveOneRankWithAReward() { + rewardData.set("EnableWeeklyAwards", true); + rewardData.set("WeeklyAwards.1-2147483647.Rewards", "example-reward"); + rewardData.set("WeeklyAwards.2-2147483647.Rewards", List.of()); + + checkSingleWarning("Weekly"); + } + private void check(YamlConfiguration configYaml, YamlConfiguration rewardsYaml) { config.setData(configYaml); config.loadValues(); From 85607af0990b0346ca890d78429bcf632d0cc1dd Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 27 Nov 2026 22:58:44 +0000 Subject: [PATCH 4/5] Recognize scalar top-voter reward names as the reward executor does --- .../votingplugin/config/VotingPluginConfigHealth.java | 10 +++++++--- .../tests/topvoter/TopVoterAwardConfigHealthTest.java | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java index 11dd32d5dd..ce825910e9 100644 --- a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java +++ b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java @@ -83,10 +83,14 @@ private void warnIfAwardsConfigured(TopVoter period, ConfigurationSection data, } private static boolean hasReward(ConfigurationSection data, String path) { + if (data.isList(path)) { + return data.getStringList(path).stream().anyMatch(name -> !name.isBlank()); + } ConfigurationSection section = data.getConfigurationSection(path); - return (section != null && !section.getKeys(false).isEmpty()) - || data.getStringList(path).stream().anyMatch(name -> !name.isBlank()) - || (data.isString(path) && !data.getString(path, "").isBlank()); + if (section != null) { + return !section.getKeys(false).isEmpty(); + } + return !data.getString(path, "").isBlank(); } private static AwardRange positiveRankRange(String place) { diff --git a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java index b9ccde20cf..9344339efb 100644 --- a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java +++ b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java @@ -71,6 +71,14 @@ void warnsForDailyNamedAward() { checkSingleWarning("Daily"); } + @Test + void warnsForUnquotedNumericRewardName() { + rewardData.set("EnableDailyRewards", true); + rewardData.set("DailyAwards.1.Rewards", 123); + + checkSingleWarning("Daily"); + } + @Test void ignoresPackagedDefaults() throws Exception { check(loadDefaults("Config.yml"), loadDefaults("SpecialRewards.yml")); From 9b6a86424430b661b4e2cc73278dff781289cc6d Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 27 Nov 2026 23:05:35 +0000 Subject: [PATCH 5/5] Preserve space-only reward names in top-voter warning checks --- .../votingplugin/config/VotingPluginConfigHealth.java | 4 ++-- .../tests/topvoter/TopVoterAwardConfigHealthTest.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java index ce825910e9..3883242879 100644 --- a/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java +++ b/VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java @@ -84,13 +84,13 @@ private void warnIfAwardsConfigured(TopVoter period, ConfigurationSection data, private static boolean hasReward(ConfigurationSection data, String path) { if (data.isList(path)) { - return data.getStringList(path).stream().anyMatch(name -> !name.isBlank()); + return data.getStringList(path).stream().anyMatch(name -> !name.isEmpty()); } ConfigurationSection section = data.getConfigurationSection(path); if (section != null) { return !section.getKeys(false).isEmpty(); } - return !data.getString(path, "").isBlank(); + return !data.getString(path, "").isEmpty(); } private static AwardRange positiveRankRange(String place) { diff --git a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java index 9344339efb..f906d61476 100644 --- a/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java +++ b/VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java @@ -79,6 +79,14 @@ void warnsForUnquotedNumericRewardName() { checkSingleWarning("Daily"); } + @Test + void warnsForSpaceOnlyRewardName() { + rewardData.set("EnableWeeklyAwards", true); + rewardData.set("WeeklyAwards.1.Rewards", List.of(" ")); + + checkSingleWarning("Weekly"); + } + @Test void ignoresPackagedDefaults() throws Exception { check(loadDefaults("Config.yml"), loadDefaults("SpecialRewards.yml"));