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:
Gabriele C
2017-05-19 19:21:05 +02:00
committed by GitHub
parent 4366e33508
commit cff8ccd76a
7 changed files with 46 additions and 3 deletions
@@ -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