Fix tests for creative user inventory challenge completion

This commit is contained in:
tastybento 2024-01-13 08:23:41 -08:00
parent 8a8124f36e
commit fe9e63f1c7
2 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,7 @@
<java.version>17</java.version> <java.version>17</java.version>
<powermock.version>2.0.9</powermock.version> <powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.20.1-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<spigot-annotations.version>1.2.3-SNAPSHOT</spigot-annotations.version> <spigot-annotations.version>1.2.3-SNAPSHOT</spigot-annotations.version>
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version> <bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
<level.version>2.6.3</level.version> <level.version>2.6.3</level.version>
@ -369,6 +369,8 @@
<!-- This is required to prevent Jacoco from adding <!-- This is required to prevent Jacoco from adding
synthetic fields to a JavaBean class (causes errors in testing) --> synthetic fields to a JavaBean class (causes errors in testing) -->
<exclude>**/*Names*</exclude> <exclude>**/*Names*</exclude>
<!-- Prevents the Material is too large to mock error -->
<exclude>org/bukkit/Material*</exclude>
</excludes> </excludes>
</configuration> </configuration>
<executions> <executions>

View File

@ -499,7 +499,9 @@ public class TryToCompleteTest {
public void testCompleteChallengesAddonUserChallengeWorldStringStringSuccessCreative() { public void testCompleteChallengesAddonUserChallengeWorldStringStringSuccessCreative() {
when(player.getGameMode()).thenReturn(GameMode.CREATIVE); when(player.getGameMode()).thenReturn(GameMode.CREATIVE);
assertTrue(TryToComplete.complete(addon, user, challenge, world, topLabel, permissionPrefix)); assertTrue(TryToComplete.complete(addon, user, challenge, world, topLabel, permissionPrefix));
verify(user).getTranslation(any(World.class), eq("challenges.messages.you-completed-challenge"), eq("[value]"),eq("name")); // Creative players automatically complete inventory challenges twice - they have infinite inventory
verify(user).getTranslation(world, "challenges.messages.you-repeated-challenge-multiple", "[value]", "name",
"[count]", "2");
} }
/** /**