Merge "RebuildNoteDbIT: Replace to be deprecated Files.append with Files.asCharSink"

This commit is contained in:
David Pursehouse
2017-06-02 12:18:07 +00:00
committed by Gerrit Code Review

View File

@@ -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");
} }