Implement onSessionLogin trigger for commands.yml (#1198)
* Implement onSessionLogin trigger for commands.yml Needs test methods, @ljacqu any advice? * Add simple onSessionLogin test
This commit is contained in:
@@ -92,6 +92,21 @@ public class CommandManagerTest {
|
||||
verifyZeroInteractions(geoIpService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldExecuteCommandsOnSessionLogin() {
|
||||
// given
|
||||
copyJarFileAsCommandsYml(TEST_FILES_FOLDER + "commands.complete.yml");
|
||||
initManager();
|
||||
|
||||
// when
|
||||
manager.runCommandsOnSessionLogin(player);
|
||||
|
||||
// then
|
||||
verify(bukkitService).dispatchConsoleCommand("msg Bobby Session login!");
|
||||
verifyNoMoreInteractions(bukkitService);
|
||||
verifyZeroInteractions(geoIpService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldExecuteCommandsOnJoin() {
|
||||
// given
|
||||
|
||||
@@ -21,3 +21,7 @@ onLogin:
|
||||
display_list:
|
||||
command: 'list'
|
||||
executor: PLAYER
|
||||
onSessionLogin:
|
||||
welcome:
|
||||
command: 'msg %p Session login!'
|
||||
executor: CONSOLE
|
||||
|
||||
Reference in New Issue
Block a user