mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-25 02:27:44 +01:00
Fixed tests
This commit is contained in:
parent
819096eba9
commit
5a573bdbbe
@ -165,7 +165,7 @@ public class CycleClickTest {
|
||||
when(flag.toPanelItem(Mockito.any(), Mockito.any())).thenReturn(panelItem);
|
||||
when(panelItem.getItem()).thenReturn(mock(ItemStack.class));
|
||||
FlagsManager fm = mock(FlagsManager.class);
|
||||
when(fm.getFlagByID(Mockito.anyString())).thenReturn(flag);
|
||||
when(fm.getFlag(Mockito.anyString())).thenReturn(Optional.of(flag));
|
||||
when(plugin.getFlagsManager()).thenReturn(fm);
|
||||
|
||||
rm = mock(RanksManager.class);
|
||||
|
@ -4,6 +4,7 @@ import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
@ -82,7 +83,7 @@ public class IslandToggleClickTest {
|
||||
PanelItem item = mock(PanelItem.class);
|
||||
when(item.getItem()).thenReturn(mock(ItemStack.class));
|
||||
when(flag.toPanelItem(Mockito.any(), Mockito.eq(user))).thenReturn(item);
|
||||
when(fm.getFlagByID(Mockito.anyString())).thenReturn(flag);
|
||||
when(fm.getFlag(Mockito.anyString())).thenReturn(Optional.of(flag));
|
||||
when(plugin.getFlagsManager()).thenReturn(fm);
|
||||
|
||||
// Island Manager
|
||||
|
@ -28,6 +28,8 @@ import world.bentobox.bentobox.managers.FlagsManager;
|
||||
import world.bentobox.bentobox.managers.IslandWorldManager;
|
||||
import world.bentobox.bentobox.util.Util;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest({BentoBox.class, Util.class })
|
||||
public class WorldToggleClickTest {
|
||||
@ -72,9 +74,8 @@ public class WorldToggleClickTest {
|
||||
PanelItem item = mock(PanelItem.class);
|
||||
when(item.getItem()).thenReturn(mock(ItemStack.class));
|
||||
when(flag.toPanelItem(Mockito.any(), Mockito.eq(user))).thenReturn(item);
|
||||
when(fm.getFlagByID(Mockito.anyString())).thenReturn(flag);
|
||||
when(fm.getFlag(Mockito.anyString())).thenReturn(Optional.of(flag));
|
||||
when(plugin.getFlagsManager()).thenReturn(fm);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -99,5 +100,4 @@ public class WorldToggleClickTest {
|
||||
Mockito.verify(flag).setSetting(Mockito.any(), Mockito.eq(true));
|
||||
Mockito.verify(panel).getInventory();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user