Fix tests - just counts of events.

This commit is contained in:
tastybento 2021-09-25 08:33:07 -07:00
parent 8b474833e1
commit 0a4fc83218
4 changed files with 9 additions and 9 deletions

View File

@ -235,7 +235,7 @@ public class AdminTeamDisbandCommandTest {
verify(user).sendMessage("commands.admin.team.disband.success", TextVariables.NAME, name[0]);
verify(p).sendMessage("commands.admin.team.disband.disbanded");
verify(p2).sendMessage("commands.admin.team.disband.disbanded");
// 2 * 2 + 1
verify(pim, times(5)).callEvent(any());
// 2 * 2
verify(pim, times(4)).callEvent(any());
}
}

View File

@ -217,8 +217,8 @@ public class AdminTeamKickCommandTest {
verify(im).removePlayer(eq(world), eq(notUUID));
verify(pm).clearHomeLocations(eq(world), eq(notUUID));
verify(user).sendMessage(eq("commands.admin.team.kick.success"), eq(TextVariables.NAME), eq(name), eq("[owner]"), anyString());
// Offline so event will be called six time
verify(pim, times(6)).callEvent(any());
// Offline so event will be called 5 times
verify(pim, times(5)).callEvent(any());
}
}

View File

@ -257,8 +257,8 @@ public class IslandResetCommandTest {
assertTrue(irc.execute(user, irc.getLabel(), Collections.emptyList()));
// TODO Verify that panel was shown
// verify(bpm).showPanel(any(), eq(user), eq(irc.getLabel()));
// Verify event (13 * 2 + 1)
verify(pim, times(27)).callEvent(any(IslandBaseEvent.class));
// Verify event (13 * 2)
verify(pim, times(26)).callEvent(any(IslandBaseEvent.class));
// Verify messaging
verify(user).sendMessage("commands.island.create.creating-island");
verify(user, never()).sendMessage(eq("commands.island.reset.kicked-from-island"), eq(TextVariables.GAMEMODE), anyString());
@ -446,8 +446,8 @@ public class IslandResetCommandTest {
// Reset command, no confirmation required
assertTrue(irc.execute(user, irc.getLabel(), Collections.singletonList("custom")));
verify(user).sendMessage("commands.island.create.creating-island");
// Verify event (13 * 2 + 1)
verify(pim, times(27)).callEvent(any(IslandBaseEvent.class));
// Verify event (13 * 2)
verify(pim, times(26)).callEvent(any(IslandBaseEvent.class));
}
}

View File

@ -168,7 +168,7 @@ public class IslandEventTest {
}
}
verify(pim, Mockito.times(Reason.values().length * 3)).callEvent(any());
verify(pim, Mockito.times(Reason.values().length * 2)).callEvent(any());
}
}