#1218 Add onLogout to commands.yml

This commit is contained in:
ljacqu
2017-05-21 13:42:49 +02:00
parent 1c46c92b4e
commit 5c6af0330e
11 changed files with 121 additions and 39 deletions
@@ -150,6 +150,21 @@ public class CommandManagerTest {
verifyNoMoreInteractions(bukkitService);
}
@Test
public void shouldExecuteCommandOnLogout() {
// given
copyJarFileAsCommandsYml(TEST_FILES_FOLDER + "commands.complete.yml");
initManager();
// when
manager.runCommandsOnLogout(player);
// then
verify(bukkitService).dispatchConsoleCommand("broadcast Bobby (127.0.0.3) logged out");
verifyNoMoreInteractions(bukkitService);
verifyZeroInteractions(geoIpService);
}
@Test
public void shouldExecuteCommandsOnRegisterWithIncompleteConfig() {
// given
@@ -25,3 +25,7 @@ onSessionLogin:
welcome:
command: 'msg %p Session login!'
executor: CONSOLE
onLogout:
announce:
command: 'broadcast %p (%ip) logged out'
executor: CONSOLE