PotionTypes have changed and now are explicitly named

For example, extended are now called
This commit is contained in:
tastybento 2023-10-11 22:46:51 -07:00
parent 9f8a6bcded
commit a2f1054bbe

View File

@ -19,6 +19,7 @@ import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionType;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
@ -29,7 +30,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
import world.bentobox.bentobox.BentoBox;
@Ignore("Needs updating - deprecated methods no long supported")
@RunWith(PowerMockRunner.class)
@PrepareForTest({BentoBox.class, Bukkit.class})
public class ItemParserTest {
@ -55,9 +56,9 @@ public class ItemParserTest {
bannerMeta = mock(BannerMeta.class);
when(itemFactory.getItemMeta(Mockito.any())).thenAnswer((Answer<ItemMeta>) invocation -> {
return switch (invocation.getArgument(0, Material.class)) {
case RED_BANNER, WHITE_BANNER -> bannerMeta;
case POTION, SPLASH_POTION, LINGERING_POTION, TIPPED_ARROW -> potionMeta;
default -> mock(ItemMeta.class);
case RED_BANNER, WHITE_BANNER -> bannerMeta;
case POTION, SPLASH_POTION, LINGERING_POTION, TIPPED_ARROW -> potionMeta;
default -> mock(ItemMeta.class);
};
});
@ -100,6 +101,7 @@ public class ItemParserTest {
*/
@Test
@Ignore("Needs updating - deprecated methods no long supported")
public void testParsePotionStrengthExtended() {
ItemStack result = ItemParser.parse("POTION:STRENGTH:1:EXTENDED::5");
assertEquals(Material.POTION, result.getType());
@ -136,6 +138,7 @@ public class ItemParserTest {
}
@Test
@Ignore("Needs updating - deprecated methods no long supported")
public void testParsePotionStrengthNotExtendedUpgradedSplash() {
ItemStack result = ItemParser.parse("POTION:STRENGTH:2::SPLASH:3");
assertEquals(Material.SPLASH_POTION, result.getType());
@ -170,6 +173,7 @@ public class ItemParserTest {
);
@Test
@Ignore("Needs updating - deprecated methods no long supported")
public void testParsePotion() {
for (PotionType type : PotionType.values()) {
for (extend e : extend.values()) {