RebuildNoteDbIT: Replace to be deprecated Files.append with Files.asCharSink
Files.append is deprecated in Guava 22 [1] in favor of Files.asCharSink. Replace it now before upgrading Guava. [1] https://github.com/google/guava/wiki/Release22 Change-Id: Ib62859fe4bfe46d08ef9fa1bc459451ec6c8bc42
This commit is contained in:
@@ -17,6 +17,7 @@ package com.google.gerrit.acceptance.pgm;
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
import com.google.common.io.FileWriteMode;
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import com.google.gerrit.launcher.GerritLauncher;
|
import com.google.gerrit.launcher.GerritLauncher;
|
||||||
import com.google.gerrit.server.notedb.ConfigNotesMigration;
|
import com.google.gerrit.server.notedb.ConfigNotesMigration;
|
||||||
@@ -44,10 +45,9 @@ public class RebuildNoteDbIT {
|
|||||||
@Test
|
@Test
|
||||||
public void rebuildEmptySite() throws Exception {
|
public void rebuildEmptySite() throws Exception {
|
||||||
initSite();
|
initSite();
|
||||||
Files.append(
|
Files.asCharSink(
|
||||||
ConfigNotesMigration.allEnabledConfig().toText(),
|
new File(sitePath.toString(), "etc/gerrit.config"), UTF_8, FileWriteMode.APPEND)
|
||||||
new File(sitePath.toString(), "etc/gerrit.config"),
|
.write(ConfigNotesMigration.allEnabledConfig().toText());
|
||||||
UTF_8);
|
|
||||||
runGerrit("RebuildNoteDb", "-d", sitePath.toString(), "--show-stack-trace");
|
runGerrit("RebuildNoteDb", "-d", sitePath.toString(), "--show-stack-trace");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user