Merge "Refactor AccountState to be a Java record"
diff --git a/javatests/com/google/gerrit/acceptance/api/change/RevertIT.java b/javatests/com/google/gerrit/acceptance/api/change/RevertIT.java
index efaa48e..a8f3db4 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/RevertIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/RevertIT.java
@@ -1626,7 +1626,34 @@
   }
 
   @Test
-  public void revertChangeWithBugAndIssueFooters() throws Exception {
+  public void revertChangeWithBugAndIssueFooters_andDefaultMessageSet() throws Exception {
+    // Create a change with bug and issue footers
+    PushOneCommit push =
+        pushFactory.create(
+            admin.newIdent(),
+            testRepo,
+            "Change with bug and issue\n" + "Bug: 12345\n" + "Issue: 67890",
+            "a.txt",
+            "content");
+    PushOneCommit.Result r = push.to("refs/for/master");
+    r.assertOkStatus();
+
+    gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(ReviewInput.approve());
+    gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).submit();
+
+    // Revert the change
+    RevertInput revertInput = new RevertInput();
+    revertInput.message = "Reverting this change because it broke tests";
+    ChangeInfo revertChange = gApi.changes().id(r.getChangeId()).revert(revertInput).get();
+
+    // Check that the revert commit message contains the footers
+    String commitMessage = gApi.changes().id(revertChange.id).current().commit(false).message;
+    assertThat(commitMessage).contains("Bug: 12345");
+    assertThat(commitMessage).contains("Issue: 67890");
+  }
+
+  @Test
+  public void revertChangeWithBugAndIssueFooters_andNoDefaultMessageSet() throws Exception {
     // Create a change with bug and issue footers
     PushOneCommit push =
         pushFactory.create(