mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
Revert "Test: use System.lineSeperator instead of \n
"
The MockTerminal used in tests uses \n always and the reverted commit re-introduced the bug which had been fixed earlier. Original commit: elastic/x-pack-elasticsearch@09b93b5565
This commit is contained in:
parent
168b566844
commit
7cb0dbe1e6
@ -16,6 +16,7 @@ import org.elasticsearch.common.Strings;
|
|||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.xpack.security.authz.RoleDescriptor;
|
import org.elasticsearch.xpack.security.authz.RoleDescriptor;
|
||||||
|
import org.elasticsearch.xpack.security.authz.permission.FieldPermissions;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@ -75,12 +76,12 @@ public class ESNativeRealmMigrateToolTests extends CommandTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
terminalLogger.log(Level.ERROR, "logging an error");
|
terminalLogger.log(Level.ERROR, "logging an error");
|
||||||
assertEquals("logging an error" + System.lineSeparator(), terminal.getOutput());
|
assertEquals("logging an error\n", terminal.getOutput());
|
||||||
terminal.reset();
|
terminal.reset();
|
||||||
assertThat(terminal.getOutput(), isEmptyString());
|
assertThat(terminal.getOutput(), isEmptyString());
|
||||||
|
|
||||||
terminalLogger.log(Level.FATAL, "logging a fatal message");
|
terminalLogger.log(Level.FATAL, "logging a fatal message");
|
||||||
assertEquals("logging a fatal message" + System.lineSeparator(), terminal.getOutput());
|
assertEquals("logging a fatal message\n", terminal.getOutput());
|
||||||
terminal.reset();
|
terminal.reset();
|
||||||
assertThat(terminal.getOutput(), isEmptyString());
|
assertThat(terminal.getOutput(), isEmptyString());
|
||||||
|
|
||||||
@ -90,7 +91,7 @@ public class ESNativeRealmMigrateToolTests extends CommandTestCase {
|
|||||||
loggingLevels.remove(Level.OFF);
|
loggingLevels.remove(Level.OFF);
|
||||||
for (Level level : loggingLevels) {
|
for (Level level : loggingLevels) {
|
||||||
terminalLogger.log(level, "this level should log " + level.name());
|
terminalLogger.log(level, "this level should log " + level.name());
|
||||||
assertEquals("this level should log " + level.name() + System.lineSeparator(), terminal.getOutput());
|
assertEquals("this level should log " + level.name() + "\n", terminal.getOutput());
|
||||||
terminal.reset();
|
terminal.reset();
|
||||||
assertThat(terminal.getOutput(), isEmptyString());
|
assertThat(terminal.getOutput(), isEmptyString());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user