mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 11:15:24 +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) {
|
private void showMembers(Island island, User user) {
|
||||||
// Gather online members
|
// Gather online members
|
||||||
List<UUID> onlineMembers = island.getMemberSet(RanksManager.MEMBER_RANK).stream()
|
List<UUID> onlineMembers = island
|
||||||
.filter(uuid -> Bukkit.getOfflinePlayer(uuid).isOnline()).collect(Collectors.toList());
|
.getMemberSet(RanksManager.MEMBER_RANK)
|
||||||
|
.stream()
|
||||||
|
.filter(uuid -> Bukkit.getOfflinePlayer(uuid)
|
||||||
|
.isOnline())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// List of ranks that we will loop through
|
// 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};
|
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.modules.junit4.PowerMockRunner;
|
||||||
import org.powermock.reflect.Whitebox;
|
import org.powermock.reflect.Whitebox;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.team.Invite.Type;
|
import world.bentobox.bentobox.api.commands.island.team.Invite.Type;
|
||||||
@ -103,6 +105,12 @@ public class IslandTeamCommandTest {
|
|||||||
when(im.getOwner(any(), any())).thenReturn(uuid);
|
when(im.getOwner(any(), any())).thenReturn(uuid);
|
||||||
// No team members
|
// No team members
|
||||||
when(im.getMembers(any(), any(UUID.class))).thenReturn(Collections.emptySet());
|
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
|
// island
|
||||||
when(im.getIsland(any(), eq(uuid))).thenReturn(island);
|
when(im.getIsland(any(), eq(uuid))).thenReturn(island);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user