diff --git a/gui/bukkit/src/test/java/it/angrybear/yagl/GUIManagerTest.java b/gui/bukkit/src/test/java/it/angrybear/yagl/GUIManagerTest.java index 0fb191ef..3d50fd35 100644 --- a/gui/bukkit/src/test/java/it/angrybear/yagl/GUIManagerTest.java +++ b/gui/bukkit/src/test/java/it/angrybear/yagl/GUIManagerTest.java @@ -31,6 +31,18 @@ class GUIManagerTest { + @Test + void testGetOpenGUIViewerUUID() { + BukkitUtils.setupServer(); + try (MockedStatic ignored = mockStatic(JavaPlugin.class)) { + JavaPlugin plugin = mock(JavaPlugin.class); + when(JavaPlugin.getProvidingPlugin(any())).thenAnswer(a -> plugin); + when(Bukkit.getPluginManager()).thenReturn(mock(PluginManager.class)); + + assertFalse(GUIManager.getOpenGUIViewer(UUID.randomUUID()).isPresent(), "Should not be present"); + } + } + @Nested class EventsTest { private GUIManager guiManager;