Fix merge from master

This commit is contained in:
Alexandre Vanhecke 2016-12-12 20:01:08 +01:00 committed by ljacqu
parent fae7286776
commit 811ceaf7ff
3 changed files with 7 additions and 5 deletions

View File

@ -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());

View File

@ -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;

View File

@ -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