From 44763a055fcdf3136346b9bd3f2f2568accc2d9f Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Sep 2018 15:47:52 +0200 Subject: [PATCH] Fix VerificationCommandTest sometimes failing - Need to set up ConsoleLogger to avoid NPE, didn't always happen because if all tests are run in a batch another test will initialize it --- .../executable/verification/VerificationCommandTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java index 53ede2d8..d4b38f1a 100644 --- a/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java +++ b/src/test/java/fr/xephi/authme/command/executable/verification/VerificationCommandTest.java @@ -1,9 +1,11 @@ package fr.xephi.authme.command.executable.verification; +import fr.xephi.authme.TestHelper; import fr.xephi.authme.data.VerificationCodeManager; import fr.xephi.authme.message.MessageKey; import fr.xephi.authme.service.CommonService; import org.bukkit.entity.Player; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -33,6 +35,11 @@ public class VerificationCommandTest { @Mock private VerificationCodeManager codeManager; + @BeforeClass + public static void setUpLogger() { + TestHelper.setupLogger(); + } + @Test public void shouldDetectIfMailHasASetup() { // given