[errorprone] Fix implicit use of default charset in FileBasedConfigTest
Change-Id: I83332efc498a5bce242915a1eec2346e6e1f58fd
This commit is contained in:
parent
2fed62528a
commit
8b00cb9324
|
@ -19,6 +19,7 @@
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.StandardOpenOption;
|
import java.nio.file.StandardOpenOption;
|
||||||
|
@ -276,7 +277,8 @@ public void testSavedConfigFileShouldNotReadUserGitConfig()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
AtomicBoolean userConfigTimeRead = new AtomicBoolean(false);
|
AtomicBoolean userConfigTimeRead = new AtomicBoolean(false);
|
||||||
|
|
||||||
Path userConfigFile = createFile(CONTENT1.getBytes(), "home");
|
Path userConfigFile = createFile(
|
||||||
|
CONTENT1.getBytes(StandardCharsets.UTF_8), "home");
|
||||||
mockSystemReader.setUserGitConfig(
|
mockSystemReader.setUserGitConfig(
|
||||||
new FileBasedConfig(userConfigFile.toFile(), FS.DETECTED) {
|
new FileBasedConfig(userConfigFile.toFile(), FS.DETECTED) {
|
||||||
|
|
||||||
|
@ -289,7 +291,8 @@ public long getTimeUnit(String section, String subsection,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Path file = createFile(CONTENT2.getBytes(), "repo");
|
Path file = createFile(CONTENT2.getBytes(StandardCharsets.UTF_8),
|
||||||
|
"repo");
|
||||||
FileBasedConfig fileBasedConfig = new FileBasedConfig(file.toFile(),
|
FileBasedConfig fileBasedConfig = new FileBasedConfig(file.toFile(),
|
||||||
FS.DETECTED);
|
FS.DETECTED);
|
||||||
fileBasedConfig.save();
|
fileBasedConfig.save();
|
||||||
|
|
Loading…
Reference in New Issue