forked from unimatrix/web
DuneRealms V2 clean baseline
Owner-authorised history reset; current source tree preserved exactly.
This commit is contained in:
commit
6deb4a2e7d
1 changed files with 65043 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
package com.example.dunerealms;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
|
||||
class AdminGuiTest {
|
||||
@Test void nonOperatorsCannotOpenMenuEvenWithAdminPermission() {
|
||||
AdminGui gui = mock(AdminGui.class);
|
||||
Player player = mock(Player.class);
|
||||
when(player.hasPermission("dune.admin")).thenReturn(true);
|
||||
doCallRealMethod().when(gui).open(player);
|
||||
gui.open(player);
|
||||
verify(player).sendMessage(contains("Operators only"));
|
||||
verify(player, never()).openInventory(any(org.bukkit.inventory.Inventory.class));
|
||||
}
|
||||
|
||||
@Test void nonOperatorsNeverReceiveAutomaticRod() {
|
||||
AdminGui gui = mock(AdminGui.class);
|
||||
Player player = mock(Player.class);
|
||||
doCallRealMethod().when(gui).giveRod(player);
|
||||
gui.giveRod(player);
|
||||
verify(player, never()).getInventory();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue

Staff