Revert "Remove redundant test for topics with quotation marks"
This reverts commit bf67ac6bffb8b8f32b19e5a656ca5d7b6b93b279.
Reason for revert: Removed the wrong test.
Change-Id: Ice79ec8cef0a4854e39ca518730dfcea3130272a
diff --git a/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java b/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java
index 60e25ed..c472128 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreatorIT.java
@@ -608,6 +608,32 @@
}
@Test
+ public void testTopicEditedListener() throws Exception {
+ Project.NameKey manifestNameKey = defaultSetup();
+ // Create initial change
+ PushOneCommit.Result result =
+ createChange(testRepo, "master", "subject", "filename", "content", "testtopic");
+ // Project name is scoped by test, so we need to get it from our initial change
+ String projectName = result.getChange().project().get();
+ createBranch(BranchNameKey.create(projectName, "ds_one"));
+ createBranch(BranchNameKey.create(projectName, "ds_two"));
+ pushDefaultConfig("automerger.config", manifestNameKey.get(), projectName, "ds_one", "ds_two");
+ // After we upload our config, we upload a new patchset to create the downstreams
+ amendChange(result.getChangeId());
+ result.assertOkStatus();
+ gApi.changes().id(result.getChangeId()).topic("multiple words");
+ gApi.changes().id(result.getChangeId()).topic("singlewordagain");
+ // Check that there are the correct number of changes in the topic
+ List<ChangeInfo> changesInTopic =
+ gApi.changes()
+ .query("topic:\"" + gApi.changes().id(result.getChangeId()).topic() + "\"")
+ .get();
+ assertThat(changesInTopic).hasSize(3);
+ // +2 and submit
+ merge(result);
+ }
+
+ @Test
public void testTopicEditedListener_withQuotes() throws Exception {
Project.NameKey manifestNameKey = defaultSetup();
// Create initial change