From 811ceaf7ffb22f60a159dea8f21ae4f7e7bf2531 Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Mon, 12 Dec 2016 20:01:08 +0100 Subject: [PATCH] Fix merge from master --- .../authme/command/executable/captcha/CaptchaCommand.java | 5 ++--- .../command/executable/captcha/CaptchaCommandTest.java | 2 +- .../fr/xephi/authme/task/LimboPlayerTaskManagerTest.java | 5 ++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/xephi/authme/command/executable/captcha/CaptchaCommand.java b/src/main/java/fr/xephi/authme/command/executable/captcha/CaptchaCommand.java index f39c7abb4..c5756cda9 100644 --- a/src/main/java/fr/xephi/authme/command/executable/captcha/CaptchaCommand.java +++ b/src/main/java/fr/xephi/authme/command/executable/captcha/CaptchaCommand.java @@ -3,7 +3,6 @@ package fr.xephi.authme.command.executable.captcha; import fr.xephi.authme.command.PlayerCommand; import fr.xephi.authme.data.CaptchaManager; import fr.xephi.authme.data.auth.PlayerCache; -import fr.xephi.authme.command.CommandService; import fr.xephi.authme.command.PlayerCommand; import fr.xephi.authme.data.limbo.LimboCache; import fr.xephi.authme.message.MessageKey; @@ -43,8 +42,8 @@ public class CaptchaCommand extends PlayerCommand { private void checkCaptcha(Player player, String captchaCode) { final boolean isCorrectCode = captchaManager.checkCode(player.getName(), captchaCode); if (isCorrectCode) { - commandService.send(player, MessageKey.CAPTCHA_SUCCESS); - commandService.send(player, MessageKey.LOGIN_MESSAGE); + commonService.send(player, MessageKey.CAPTCHA_SUCCESS); + commonService.send(player, MessageKey.LOGIN_MESSAGE); limboCache.getPlayerData(player.getName()).getMessageTask().setMuted(false); } else { String newCode = captchaManager.generateCode(player.getName()); diff --git a/src/test/java/fr/xephi/authme/command/executable/captcha/CaptchaCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/captcha/CaptchaCommandTest.java index 19920578d..dd9240058 100644 --- a/src/test/java/fr/xephi/authme/command/executable/captcha/CaptchaCommandTest.java +++ b/src/test/java/fr/xephi/authme/command/executable/captcha/CaptchaCommandTest.java @@ -2,7 +2,7 @@ package fr.xephi.authme.command.executable.captcha; import fr.xephi.authme.data.CaptchaManager; import fr.xephi.authme.data.auth.PlayerCache; -import fr.xephi.authme.command.CommandService; +import fr.xephi.authme.service.CommonService; import fr.xephi.authme.data.limbo.LimboCache; import fr.xephi.authme.data.limbo.LimboPlayer; import fr.xephi.authme.message.MessageKey; diff --git a/src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java b/src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java index 13e9c5761..6e258c429 100644 --- a/src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java +++ b/src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java @@ -20,6 +20,9 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import static fr.xephi.authme.service.BukkitService.TICKS_PER_SECOND; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -97,7 +100,7 @@ public class LimboPlayerTaskManagerTest { // given String name = "Tester1"; LimboPlayer limboPlayer = mock(LimboPlayer.class); - given(limboCache.getPlayerData(name)).willReturn(limboPlayer); + given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(0); // when