mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-24 18:17:53 +01:00
Fixed tests
This commit is contained in:
parent
18755f6377
commit
a594427c5a
@ -1,20 +1,20 @@
|
||||
package world.bentobox.bentobox.api.panels.builders;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import world.bentobox.bentobox.api.panels.PanelItem;
|
||||
import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import world.bentobox.bentobox.api.panels.PanelItem;
|
||||
import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler;
|
||||
|
||||
public class PanelItemBuilder {
|
||||
private ItemStack icon = new ItemStack(Material.AIR);
|
||||
private String name = "";
|
||||
private @Nullable String name = "";
|
||||
private List<String> description = new ArrayList<>();
|
||||
private boolean glow = false;
|
||||
private PanelItem.ClickHandler clickHandler;
|
||||
@ -43,9 +43,8 @@ public class PanelItemBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public PanelItemBuilder name(String name) {
|
||||
this.name = ChatColor.translateAlternateColorCodes('&', name);
|
||||
public PanelItemBuilder name(@Nullable String name) {
|
||||
this.name = name != null ? ChatColor.translateAlternateColorCodes('&', name) : null;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -1,19 +1,5 @@
|
||||
package world.bentobox.bentobox.listeners.flags.worldsettings;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -36,7 +22,6 @@ import org.powermock.api.mockito.PowerMockito;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import org.powermock.reflect.Whitebox;
|
||||
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||
import world.bentobox.bentobox.api.flags.Flag;
|
||||
@ -49,6 +34,20 @@ import world.bentobox.bentobox.managers.IslandWorldManager;
|
||||
import world.bentobox.bentobox.managers.IslandsManager;
|
||||
import world.bentobox.bentobox.util.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest({BentoBox.class, Util.class, Bukkit.class })
|
||||
public class InvincibleVisitorsListenerTest {
|
||||
@ -177,7 +176,7 @@ public class InvincibleVisitorsListenerTest {
|
||||
// IV settings should be empty
|
||||
assertFalse(ivSettings.contains(dc.name()));
|
||||
// Click on the icon
|
||||
listener.onClick(panel, user, clickType, slot );
|
||||
listener.onClick(panel, user, clickType, slot);
|
||||
// Should keep panel open
|
||||
Mockito.verify(user, Mockito.never()).closeInventory();
|
||||
// IV settings should now have the damage cause in it
|
||||
|
Loading…
Reference in New Issue
Block a user