Support to control notifications when creating changes through REST
Change-Id: I0792c38f429459ce2e2f74fef2dc0b962188f451 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -49,6 +49,7 @@ import com.google.gerrit.extensions.api.projects.BranchInput;
|
||||
import com.google.gerrit.extensions.api.projects.ProjectInput;
|
||||
import com.google.gerrit.extensions.client.InheritableBoolean;
|
||||
import com.google.gerrit.extensions.client.ListChangesOption;
|
||||
import com.google.gerrit.extensions.client.ProjectWatchInfo;
|
||||
import com.google.gerrit.extensions.client.SubmitType;
|
||||
import com.google.gerrit.extensions.common.ActionInfo;
|
||||
import com.google.gerrit.extensions.common.ChangeInfo;
|
||||
@@ -1237,4 +1238,17 @@ public abstract class AbstractDaemonTest {
|
||||
assertThat(m.headers().get("To").isEmpty()).isTrue();
|
||||
assertThat(m.headers().get("CC").isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
protected void watch(String project, String filter)
|
||||
throws RestApiException {
|
||||
List<ProjectWatchInfo> projectsToWatch = new ArrayList<>();
|
||||
ProjectWatchInfo pwi = new ProjectWatchInfo();
|
||||
pwi.project = project;
|
||||
pwi.filter = filter;
|
||||
pwi.notifyAbandonedChanges = true;
|
||||
pwi.notifyNewChanges = true;
|
||||
pwi.notifyAllComments = true;
|
||||
projectsToWatch.add(pwi);
|
||||
gApi.accounts().self().setWatchedProjects(projectsToWatch);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user