Support ChangeUpdates without providing a CurrentUser
We want to thin out the dependency stack of ChangeRebuilderImpl in our custom online rebuilding implementation. Using full ChangeControls and IdentifiedUsers brings in way more than we need to just create author idents containing the user's full name. Rework AbstractChangeUpdate to just take an Account.Id and prepopulated PersonIdent, and teach ChangeRebuilderImpl to use that path. Change-Id: I79af43ff21fbd27ad682134d37fae75f043a586a
This commit is contained in:
@@ -207,6 +207,7 @@ public abstract class AbstractChangeNotesTest extends GerritBaseTests {
|
||||
protected ChangeUpdate newUpdate(Change c, CurrentUser user)
|
||||
throws Exception {
|
||||
ChangeUpdate update = TestChanges.newUpdate(injector, c, user);
|
||||
update.setPatchSetId(c.currentPatchSetId());
|
||||
update.setAllowWriteToNewRef(true);
|
||||
return update;
|
||||
}
|
||||
|
@@ -1760,7 +1760,7 @@ public class ChangeNotesTest extends AbstractChangeNotesTest {
|
||||
assertThat(msg.getAuthor()).isNull();
|
||||
|
||||
update = newUpdate(c, internalUser);
|
||||
exception.expect(UnsupportedOperationException.class);
|
||||
exception.expect(IllegalStateException.class);
|
||||
update.putApproval("Code-Review", (short) 1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user