PushOneCommit: Add another factory method that accepts file map and changeId
The code-owners plugins needs this method for a test. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I89f3e46c14d8282107c0d310e804bf49a671aeb8
This commit is contained in:
		@@ -25,6 +25,8 @@ import com.google.common.collect.ImmutableMap;
 | 
				
			|||||||
import com.google.common.collect.Iterables;
 | 
					import com.google.common.collect.Iterables;
 | 
				
			||||||
import com.google.common.collect.Sets;
 | 
					import com.google.common.collect.Sets;
 | 
				
			||||||
import com.google.gerrit.common.Nullable;
 | 
					import com.google.gerrit.common.Nullable;
 | 
				
			||||||
 | 
					import com.google.gerrit.common.UsedAt;
 | 
				
			||||||
 | 
					import com.google.gerrit.common.UsedAt.Project;
 | 
				
			||||||
import com.google.gerrit.entities.Account;
 | 
					import com.google.gerrit.entities.Account;
 | 
				
			||||||
import com.google.gerrit.entities.Change;
 | 
					import com.google.gerrit.entities.Change;
 | 
				
			||||||
import com.google.gerrit.entities.PatchSet;
 | 
					import com.google.gerrit.entities.PatchSet;
 | 
				
			||||||
@@ -91,6 +93,14 @@ public class PushOneCommit {
 | 
				
			|||||||
        @Assisted String subject,
 | 
					        @Assisted String subject,
 | 
				
			||||||
        @Assisted Map<String, String> files);
 | 
					        @Assisted Map<String, String> files);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @UsedAt(Project.PLUGIN_CODE_OWNERS)
 | 
				
			||||||
 | 
					    PushOneCommit create(
 | 
				
			||||||
 | 
					        PersonIdent i,
 | 
				
			||||||
 | 
					        TestRepository<?> testRepo,
 | 
				
			||||||
 | 
					        @Assisted("subject") String subject,
 | 
				
			||||||
 | 
					        @Assisted Map<String, String> files,
 | 
				
			||||||
 | 
					        @Assisted("changeId") String changeId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PushOneCommit create(
 | 
					    PushOneCommit create(
 | 
				
			||||||
        PersonIdent i,
 | 
					        PersonIdent i,
 | 
				
			||||||
        TestRepository<?> testRepo,
 | 
					        TestRepository<?> testRepo,
 | 
				
			||||||
@@ -227,15 +237,16 @@ public class PushOneCommit {
 | 
				
			|||||||
        changeId);
 | 
					        changeId);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private PushOneCommit(
 | 
					  @AssistedInject
 | 
				
			||||||
 | 
					  PushOneCommit(
 | 
				
			||||||
      ChangeNotes.Factory notesFactory,
 | 
					      ChangeNotes.Factory notesFactory,
 | 
				
			||||||
      ApprovalsUtil approvalsUtil,
 | 
					      ApprovalsUtil approvalsUtil,
 | 
				
			||||||
      Provider<InternalChangeQuery> queryProvider,
 | 
					      Provider<InternalChangeQuery> queryProvider,
 | 
				
			||||||
      PersonIdent i,
 | 
					      @Assisted PersonIdent i,
 | 
				
			||||||
      TestRepository<?> testRepo,
 | 
					      @Assisted TestRepository<?> testRepo,
 | 
				
			||||||
      String subject,
 | 
					      @Assisted("subject") String subject,
 | 
				
			||||||
      Map<String, String> files,
 | 
					      @Assisted Map<String, String> files,
 | 
				
			||||||
      String changeId)
 | 
					      @Nullable @Assisted("changeId") String changeId)
 | 
				
			||||||
      throws Exception {
 | 
					      throws Exception {
 | 
				
			||||||
    this.testRepo = testRepo;
 | 
					    this.testRepo = testRepo;
 | 
				
			||||||
    this.notesFactory = notesFactory;
 | 
					    this.notesFactory = notesFactory;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,6 +34,7 @@ public @interface UsedAt {
 | 
				
			|||||||
    GOOGLE,
 | 
					    GOOGLE,
 | 
				
			||||||
    COLLABNET,
 | 
					    COLLABNET,
 | 
				
			||||||
    PLUGIN_CHECKS,
 | 
					    PLUGIN_CHECKS,
 | 
				
			||||||
 | 
					    PLUGIN_CODE_OWNERS,
 | 
				
			||||||
    PLUGIN_DELETE_PROJECT,
 | 
					    PLUGIN_DELETE_PROJECT,
 | 
				
			||||||
    PLUGIN_SERVICEUSER,
 | 
					    PLUGIN_SERVICEUSER,
 | 
				
			||||||
    PLUGINS_ALL, // Use this project if a method/type is generally made available to all plugins.
 | 
					    PLUGINS_ALL, // Use this project if a method/type is generally made available to all plugins.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user