plugins/DuneMenus/src/test/java/com/dunerealms/menus/RetainedNativeMenusAbiTest.java
unimatrixgit ac8ac24584
Some checks failed
DuneRealms Plugin CI / plugins (push) Has been cancelled
Spice Cookers and Rails Build / spice-cookers-rails (push) Has been cancelled
Grade spice recipes and expose the in-game Cookbook
2026-12-03 22:18:04 +01:00

13 lines
1.5 KiB
Java

package com.dunerealms.menus;
import java.util.*;import java.util.function.BooleanSupplier;import org.bukkit.entity.Player;import org.bukkit.inventory.Inventory;import org.bukkit.plugin.java.JavaPlugin;import org.junit.jupiter.api.Test;import static org.junit.jupiter.api.Assertions.*;
/** Contract taken from actual retained Core/Ess NativeMenus, not from the new renderer implementation. */
class RetainedNativeMenusAbiTest {
@Test void retainedInventoryFacadeCanFindExactBooleanShowSignatures()throws Exception{
assertEquals(boolean.class,DuneMenusPlugin.class.getMethod("show",JavaPlugin.class,Player.class,String.class,Inventory.class,Map.class,BooleanSupplier.class).getReturnType());
assertEquals(boolean.class,DuneMenusPlugin.class.getMethod("show",JavaPlugin.class,Player.class,String.class,Inventory.class,Map.class).getReturnType());
}
@Test void retainedCurrentCloseAndChoiceFacadeArePresent()throws Exception{
assertEquals(boolean.class,DuneMenusPlugin.class.getMethod("isCurrent",Player.class,Inventory.class).getReturnType());assertEquals(void.class,DuneMenusPlugin.class.getMethod("close",Player.class,Inventory.class).getReturnType());assertEquals(boolean.class,DuneMenusPlugin.class.getMethod("showChoices",JavaPlugin.class,Player.class,String.class,String.class,List.class).getReturnType());
}
@Test void allPublicServiceRoutesHaveNativeEntriesInsteadOfPartialAlternateBackends(){assertEquals(Set.of("hub","travel","exchange","clan","company","missions","spice","war","politics","lore","cookbook","mentat","house","equipment"),NativeServiceMenu.IDS);}
}