mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-03 09:10:01 +01:00
Fix unit testing
This commit is contained in:
parent
41af94aab2
commit
29c30f6c22
@ -805,19 +805,18 @@ public class PlayerListenerTest {
|
|||||||
Player player = mock(Player.class);
|
Player player = mock(Player.class);
|
||||||
given(player.getName()).willReturn("doooew");
|
given(player.getName()).willReturn("doooew");
|
||||||
given(player.getDisplayName()).willReturn("Displ");
|
given(player.getDisplayName()).willReturn("Displ");
|
||||||
given(player.getPlayerListName()).willReturn("List");
|
|
||||||
String joinMsg = "The player joined";
|
String joinMsg = "The player joined";
|
||||||
PlayerJoinEvent event = new PlayerJoinEvent(player, joinMsg);
|
PlayerJoinEvent event = new PlayerJoinEvent(player, joinMsg);
|
||||||
given(settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)).willReturn(false);
|
given(settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)).willReturn(false);
|
||||||
given(settings.getProperty(RegistrationSettings.CUSTOM_JOIN_MESSAGE))
|
given(settings.getProperty(RegistrationSettings.CUSTOM_JOIN_MESSAGE))
|
||||||
.willReturn("Hello {PLAYERNAME} (aka {DISPLAYNAME} / {PLAYERLISTNAME})");
|
.willReturn("Hello {PLAYERNAME} (aka {DISPLAYNAME})");
|
||||||
given(settings.getProperty(RegistrationSettings.DELAY_JOIN_MESSAGE)).willReturn(false);
|
given(settings.getProperty(RegistrationSettings.DELAY_JOIN_MESSAGE)).willReturn(false);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
listener.onJoinMessage(event);
|
listener.onJoinMessage(event);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertThat(event.getJoinMessage(), equalTo("Hello doooew (aka Displ / List)"));
|
assertThat(event.getJoinMessage(), equalTo("Hello doooew (aka Displ)"));
|
||||||
verifyZeroInteractions(joinMessageService);
|
verifyZeroInteractions(joinMessageService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -827,7 +826,6 @@ public class PlayerListenerTest {
|
|||||||
Player player = mock(Player.class);
|
Player player = mock(Player.class);
|
||||||
given(player.getName()).willReturn("thename0");
|
given(player.getName()).willReturn("thename0");
|
||||||
given(player.getDisplayName()).willReturn("(not used)");
|
given(player.getDisplayName()).willReturn("(not used)");
|
||||||
given(player.getPlayerListName()).willReturn("listName");
|
|
||||||
String joinMsg = "The player joined";
|
String joinMsg = "The player joined";
|
||||||
PlayerJoinEvent event = new PlayerJoinEvent(player, joinMsg);
|
PlayerJoinEvent event = new PlayerJoinEvent(player, joinMsg);
|
||||||
given(settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)).willReturn(false);
|
given(settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)).willReturn(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user