DuneRealms V2 clean baseline

Owner-authorised history reset; current source tree preserved exactly.
This commit is contained in:
Dev 2026-11-13 00:05:14 +01:00
commit 6deb4a2e7d

View file

@ -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();
}
}