13 lines
1.5 KiB
Java
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);}
|
|
}
|

Staff