TestChanges: Use a standard mock for ChangeControl

In addition to disabling order checks, a nice mock also returns 0 or
null for methods that are not explicitly mocked. TestChanges sets up
ChangeControls to make them act basically like ChangeControls; this
property of nice mocks does not play nicely with callers' assumptions.

Change-Id: I7aac46acda7cfed9195d8f52981cf4dfbe755b7d
This commit is contained in:
Dave Borowitz 2015-11-20 14:04:01 -05:00
parent 01a68afa0f
commit 9727353fe0

View File

@ -102,7 +102,7 @@ public class TestChanges {
GitRepositoryManager repoManager, NotesMigration migration,
Change c, AllUsersNameProvider allUsers,
IdentifiedUser user) throws OrmException {
ChangeControl ctl = EasyMock.createNiceMock(ChangeControl.class);
ChangeControl ctl = EasyMock.createMock(ChangeControl.class);
expect(ctl.getChange()).andStubReturn(c);
expect(ctl.getUser()).andStubReturn(user);
ChangeNotes notes = new ChangeNotes(repoManager, migration, allUsers, c)