mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 03:05:16 +01:00
Fixes tests for IslandTeamCommand
This commit is contained in:
parent
6d3e5914a9
commit
a27f54a6f7
@ -88,8 +88,12 @@ public class IslandTeamCommand extends CompositeCommand {
|
||||
|
||||
private void showMembers(Island island, User user) {
|
||||
// Gather online members
|
||||
List<UUID> onlineMembers = island.getMemberSet(RanksManager.MEMBER_RANK).stream()
|
||||
.filter(uuid -> Bukkit.getOfflinePlayer(uuid).isOnline()).collect(Collectors.toList());
|
||||
List<UUID> onlineMembers = island
|
||||
.getMemberSet(RanksManager.MEMBER_RANK)
|
||||
.stream()
|
||||
.filter(uuid -> Bukkit.getOfflinePlayer(uuid)
|
||||
.isOnline())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// List of ranks that we will loop through
|
||||
Integer[] ranks = new Integer[]{RanksManager.OWNER_RANK, RanksManager.SUB_OWNER_RANK, RanksManager.MEMBER_RANK, RanksManager.TRUSTED_RANK, RanksManager.COOP_RANK};
|
||||
|
@ -28,6 +28,8 @@ import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import org.powermock.reflect.Whitebox;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.commands.island.team.Invite.Type;
|
||||
@ -103,6 +105,12 @@ public class IslandTeamCommandTest {
|
||||
when(im.getOwner(any(), any())).thenReturn(uuid);
|
||||
// No team members
|
||||
when(im.getMembers(any(), any(UUID.class))).thenReturn(Collections.emptySet());
|
||||
// Add members
|
||||
ImmutableSet<UUID> set = new ImmutableSet.Builder<UUID>().build();
|
||||
// No members
|
||||
when(island.getMemberSet(anyInt(), any(Boolean.class))).thenReturn(set);
|
||||
when(island.getMemberSet(anyInt())).thenReturn(set);
|
||||
when(island.getMemberSet()).thenReturn(set);
|
||||
// island
|
||||
when(im.getIsland(any(), eq(uuid))).thenReturn(island);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user