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
|
@Before
|
||||||
public void setUp() throws Exception {
|
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);
|
user = mock(User.class);
|
||||||
inv = mock(PlayerInventory.class);
|
inv = mock(PlayerInventory.class);
|
||||||
when(inv.getContents()).thenReturn(stacks);
|
when(inv.getContents()).thenReturn(stacks);
|
||||||
|
@ -63,7 +68,6 @@ public class TryToCompleteTest {
|
||||||
addon = mock(ChallengesAddon.class);
|
addon = mock(ChallengesAddon.class);
|
||||||
required = new ArrayList<>();
|
required = new ArrayList<>();
|
||||||
|
|
||||||
Server server = mock(Server.class);
|
|
||||||
ItemFactory itemFactory = mock(ItemFactory.class);
|
ItemFactory itemFactory = mock(ItemFactory.class);
|
||||||
when(server.getItemFactory()).thenReturn(itemFactory);
|
when(server.getItemFactory()).thenReturn(itemFactory);
|
||||||
|
|
||||||
|
@ -71,9 +75,6 @@ public class TryToCompleteTest {
|
||||||
when(itemFactory.getItemMeta(any())).thenReturn(null);
|
when(itemFactory.getItemMeta(any())).thenReturn(null);
|
||||||
when(itemFactory.equals(null, null)).thenReturn(true);
|
when(itemFactory.equals(null, null)).thenReturn(true);
|
||||||
|
|
||||||
PowerMockito.mockStatic(Bukkit.class);
|
|
||||||
when(Bukkit.getServer()).thenReturn(server);
|
|
||||||
|
|
||||||
when(Bukkit.getItemFactory()).thenReturn(itemFactory);
|
when(Bukkit.getItemFactory()).thenReturn(itemFactory);
|
||||||
when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger());
|
when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue