summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky <david.ostrovsky@gmail.com>2021-02-02 10:21:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-02-02 10:21:32 +0000
commite3f8b34761600facc90b3127d5a0f7155a7ff9de (patch)
tree2d274a2f5935b4a159b514e2a9275d9ca839565f
parentb284ad514cf43c36c05d76c84f1b713864694c1c (diff)
parent8838f1a3664d62f2dbcd9254227de9ab65c0b9ec (diff)
Merge "Do not remove Change-Id footer in test" into stable-2.16
-rw-r--r--javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java3
-rw-r--r--javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java6
2 files changed, 6 insertions, 3 deletions
diff --git a/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java b/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java
index dfd25e25cb..f41f4acb20 100644
--- a/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java
@@ -876,7 +876,8 @@ public class RobotCommentsIT extends AbstractDaemonTest {
public void fixDoesNotModifyCommitMessageOfChangeEdit() throws Exception {
assume().that(notesMigration.readChanges()).isTrue();
- String changeEditCommitMessage = "This is the commit message of the change edit.\n";
+ String changeEditCommitMessage =
+ "This is the commit message of the change edit.\n\nChange-Id: " + changeId + "\n";
gApi.changes().id(changeId).edit().modifyCommitMessage(changeEditCommitMessage);
fixReplacementInfo.path = FILE_NAME;
diff --git a/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java b/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java
index 7a67fba910..12df63acc1 100644
--- a/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java
+++ b/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java
@@ -324,12 +324,14 @@ public class ChangeEditIT extends AbstractDaemonTest {
@Test
public void updateCommitMessageByEditingMagicCommitMsgFile() throws Exception {
createEmptyEditFor(changeId);
+ String updatedCommitMsg = "Foo Bar\n\nChange-Id: " + changeId + "\n";
gApi.changes()
.id(changeId)
.edit()
- .modifyFile(Patch.COMMIT_MSG, RawInputUtil.create("Foo Bar".getBytes(UTF_8)));
+ .modifyFile(Patch.COMMIT_MSG, RawInputUtil.create(updatedCommitMsg.getBytes(UTF_8)));
assertThat(getEdit(changeId)).isPresent();
- ensureSameBytes(getFileContentOfEdit(changeId, Patch.COMMIT_MSG), "Foo Bar\n".getBytes(UTF_8));
+ ensureSameBytes(
+ getFileContentOfEdit(changeId, Patch.COMMIT_MSG), updatedCommitMsg.getBytes(UTF_8));
}
@Test