Skip to content

Commit

Permalink
Fix tests for creative user inventory challenge completion
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jan 13, 2024
1 parent 8a8124f commit fe9e63f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<java.version>17</java.version>
<powermock.version>2.0.9</powermock.version>
<!-- 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>
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
<level.version>2.6.3</level.version>
Expand Down Expand Up @@ -369,6 +369,8 @@
<!-- This is required to prevent Jacoco from adding
synthetic fields to a JavaBean class (causes errors in testing) -->
<exclude>**/*Names*</exclude>
<!-- Prevents the Material is too large to mock error -->
<exclude>org/bukkit/Material*</exclude>
</excludes>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ public void testCompleteChallengesAddonUserChallengeWorldStringStringSuccessMult
public void testCompleteChallengesAddonUserChallengeWorldStringStringSuccessCreative() {
when(player.getGameMode()).thenReturn(GameMode.CREATIVE);
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");
}

/**
Expand Down

0 comments on commit fe9e63f

Please sign in to comment.