From 018455f8f6311a80f2ab53817dbc72b67e275884 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 23 Sep 2021 17:12:59 -0700 Subject: [PATCH] Prevent errors in TryToCompleteTest Note - tests still fail. --- .../world/bentobox/challenges/tasks/TryToCompleteTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java b/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java index bfc2831..69705cf 100644 --- a/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java +++ b/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java @@ -202,7 +202,10 @@ public class TryToCompleteTest { // User has all perms by default when(user.hasPermission(anyString())).thenReturn(true); when(user.getPlayer()).thenReturn(player); + UUID uniqueId = UUID.randomUUID(); + when(user.getUniqueId()).thenReturn(uniqueId); when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgument(0, String.class)); + when(user.getTranslationOrNothing(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgument(0, String.class)); when(user.getName()).thenReturn("tastybento"); @Nullable Location userLoc = mock(Location.class);