#1141 Make 2fa messages translatable, various cleanups (null safety, ...)

This commit is contained in:
ljacqu
2018-03-21 23:56:13 +01:00
parent 584a0bebbf
commit e9ab82db6b
10 changed files with 78 additions and 28 deletions
@@ -4,9 +4,9 @@ import com.warrenstrange.googleauth.IGoogleAuthenticator;
import fr.xephi.authme.security.totp.TotpAuthenticator.TotpGenerationResult;
import fr.xephi.authme.service.BukkitService;
import org.bukkit.entity.Player;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.verifyZeroInteractions;
@RunWith(MockitoJUnitRunner.class)
public class TotpAuthenticatorTest {
@InjectMocks
private TotpAuthenticator totpAuthenticator;
@Mock
@@ -35,6 +34,11 @@ public class TotpAuthenticatorTest {
@Mock
private IGoogleAuthenticator googleAuthenticator;
@Before
public void initializeTotpAuthenticator() {
totpAuthenticator = new TotpAuthenticator(googleAuthenticator, bukkitService);
}
@Test
public void shouldGenerateTotpKey() {
// given
@@ -65,9 +65,6 @@ commands:
arg1:
label: loginArg
nonExistent: does not exist
arg2:
label: 2faArg
rhetorical: false
someProp:
label: '''someProp'' does not exist'
description: idk