mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-02-05 23:11:41 +01:00
Fix failing Tests.
These tests failed because in I added Server version check in ChallengesAddon class.
This commit is contained in:
parent
330034ea8e
commit
deab2d3530
@ -56,6 +56,11 @@ public class TryToCompleteTest {
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
Server server = mock(Server.class);
|
||||
PowerMockito.mockStatic(Bukkit.class);
|
||||
when(Bukkit.getServer()).thenReturn(server);
|
||||
when(Bukkit.getBukkitVersion()).thenReturn("1.13.2");
|
||||
|
||||
user = mock(User.class);
|
||||
inv = mock(PlayerInventory.class);
|
||||
when(inv.getContents()).thenReturn(stacks);
|
||||
@ -63,7 +68,6 @@ public class TryToCompleteTest {
|
||||
addon = mock(ChallengesAddon.class);
|
||||
required = new ArrayList<>();
|
||||
|
||||
Server server = mock(Server.class);
|
||||
ItemFactory itemFactory = mock(ItemFactory.class);
|
||||
when(server.getItemFactory()).thenReturn(itemFactory);
|
||||
|
||||
@ -71,9 +75,6 @@ public class TryToCompleteTest {
|
||||
when(itemFactory.getItemMeta(any())).thenReturn(null);
|
||||
when(itemFactory.equals(null, null)).thenReturn(true);
|
||||
|
||||
PowerMockito.mockStatic(Bukkit.class);
|
||||
when(Bukkit.getServer()).thenReturn(server);
|
||||
|
||||
when(Bukkit.getItemFactory()).thenReturn(itemFactory);
|
||||
when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user