use of com.google.gerrit.server.edit.CommitModification in project gerrit by GerritCodeReview.
the class FixReplacementInterpreterTest method replacementIsTranslatedToTreeModification.
@Test
public void replacementIsTranslatedToTreeModification() throws Exception {
FixReplacement fixReplacement = new FixReplacement(filePath1, new Range(1, 1, 3, 2), "Modified content");
mockFileContent(filePath1, "First line\nSecond line\nThird line\n");
CommitModification commitModification = toCommitModification(fixReplacement);
ImmutableList<TreeModification> treeModifications = commitModification.treeModifications();
assertThatList(treeModifications).onlyElement().asChangeFileContentModification().filePaths().containsExactly(filePath1);
assertThatList(treeModifications).onlyElement().asChangeFileContentModification().newContent().isEqualTo("FModified contentird line\n");
}
Aggregations