Fix null pointer in tests

This commit is contained in:
ljacqu 2016-01-07 20:49:41 +01:00
parent fab13c586f
commit 120e69ac67
2 changed files with 11 additions and 3 deletions

View File

@ -2,15 +2,15 @@ package fr.xephi.authme.security.crypts;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.WrapperMock; import fr.xephi.authme.util.WrapperMock;
import org.junit.Before; import org.junit.BeforeClass;
/** /**
* Test for {@link BCRYPT}. * Test for {@link BCRYPT}.
*/ */
public class BcryptTest extends AbstractEncryptionMethodTest { public class BcryptTest extends AbstractEncryptionMethodTest {
@Before @BeforeClass
public void setUpSettings() { public static void setUpSettings() {
WrapperMock.createInstance(); WrapperMock.createInstance();
Settings.bCryptLog2Rounds = 8; Settings.bCryptLog2Rounds = 8;
} }

View File

@ -1,10 +1,18 @@
package fr.xephi.authme.security.crypts; package fr.xephi.authme.security.crypts;
import fr.xephi.authme.util.WrapperMock;
import org.junit.BeforeClass;
/** /**
* Test for {@link XFBCRYPT}. * Test for {@link XFBCRYPT}.
*/ */
public class XFBCRYPTTest extends AbstractEncryptionMethodTest { public class XFBCRYPTTest extends AbstractEncryptionMethodTest {
@BeforeClass
public static void setUpWrapper() {
WrapperMock.createInstance();
}
public XFBCRYPTTest() { public XFBCRYPTTest() {
super(new XFBCRYPT(), super(new XFBCRYPT(),
"$2a$10$UtuON/ZG.x8EWG/zQbryB.BHfQVrfxk3H7qykzP.UJQ8YiLjZyfqq", // password "$2a$10$UtuON/ZG.x8EWG/zQbryB.BHfQVrfxk3H7qykzP.UJQ8YiLjZyfqq", // password