Change message verification task to add todo comments in same order
- Make verification task add todo comments to YML files in the same order as the MessageKey enum - Use DefaultCharsets everywhere instead of Guava's Charsets class (thanks to DNx5)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package fr.xephi.authme;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import fr.xephi.authme.output.LogLevel;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
@@ -18,6 +17,7 @@ import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
@@ -91,7 +91,7 @@ public class ConsoleLoggerTest {
|
||||
// then
|
||||
verify(logger, times(2)).info(anyString());
|
||||
verifyNoMoreInteractions(logger);
|
||||
List<String> loggedLines = Files.readAllLines(logFile.toPath(), Charsets.UTF_8);
|
||||
List<String> loggedLines = Files.readAllLines(logFile.toPath(), StandardCharsets.UTF_8);
|
||||
assertThat(loggedLines, hasSize(2));
|
||||
assertThat(loggedLines.get(0), containsString("[FINE] Logging a FINE message"));
|
||||
assertThat(loggedLines.get(1), containsString("[INFO] This is an INFO message"));
|
||||
@@ -129,7 +129,7 @@ public class ConsoleLoggerTest {
|
||||
verify(logger).info("Info text");
|
||||
verify(logger).warning("Exception occurred: [IllegalStateException]: Test exception message");
|
||||
verifyNoMoreInteractions(logger);
|
||||
List<String> loggedLines = Files.readAllLines(logFile.toPath(), Charsets.UTF_8);
|
||||
List<String> loggedLines = Files.readAllLines(logFile.toPath(), StandardCharsets.UTF_8);
|
||||
assertThat(loggedLines.size(), greaterThan(3));
|
||||
assertThat(loggedLines.get(0), containsString("[INFO] Info text"));
|
||||
assertThat(loggedLines.get(1),
|
||||
|
||||
Reference in New Issue
Block a user