mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 02:35:11 +01:00
Fix unit test #1344
This commit is contained in:
parent
10c09dbf17
commit
d6e2f35efd
@ -805,18 +805,19 @@ public class PlayerListenerTest {
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn("doooew");
|
||||
given(player.getDisplayName()).willReturn("Displ");
|
||||
given(player.getPlayerListName()).willReturn("List");
|
||||
String joinMsg = "The player joined";
|
||||
PlayerJoinEvent event = new PlayerJoinEvent(player, joinMsg);
|
||||
given(settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)).willReturn(false);
|
||||
given(settings.getProperty(RegistrationSettings.CUSTOM_JOIN_MESSAGE))
|
||||
.willReturn("Hello {PLAYERNAME} (aka {DISPLAYNAME})");
|
||||
.willReturn("Hello {PLAYERNAME} (aka {DISPLAYNAME} / {PLAYERLISTNAME})");
|
||||
given(settings.getProperty(RegistrationSettings.DELAY_JOIN_MESSAGE)).willReturn(false);
|
||||
|
||||
// when
|
||||
listener.onJoinMessage(event);
|
||||
|
||||
// then
|
||||
assertThat(event.getJoinMessage(), equalTo("Hello doooew (aka Displ)"));
|
||||
assertThat(event.getJoinMessage(), equalTo("Hello doooew (aka Displ / List)"));
|
||||
verifyZeroInteractions(joinMessageService);
|
||||
}
|
||||
|
||||
@ -826,6 +827,7 @@ public class PlayerListenerTest {
|
||||
Player player = mock(Player.class);
|
||||
given(player.getName()).willReturn("thename0");
|
||||
given(player.getDisplayName()).willReturn("(not used)");
|
||||
given(player.getPlayerListName()).willReturn("listName");
|
||||
String joinMsg = "The player joined";
|
||||
PlayerJoinEvent event = new PlayerJoinEvent(player, joinMsg);
|
||||
given(settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)).willReturn(false);
|
||||
|
@ -7,6 +7,7 @@ import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.GeoIpService;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
@ -49,6 +50,8 @@ public class WelcomeMessageConfigurationTest {
|
||||
private GeoIpService geoIpService;
|
||||
@Mock
|
||||
private PlayerCache playerCache;
|
||||
@Mock
|
||||
private CommonService service;
|
||||
@DataFolder
|
||||
private File testPluginFolder;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user