From 9727353fe0fd368403e904f865eac485427af3b0 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 20 Nov 2015 14:04:01 -0500 Subject: [PATCH] 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 --- .../src/test/java/com/google/gerrit/testutil/TestChanges.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-server/src/test/java/com/google/gerrit/testutil/TestChanges.java b/gerrit-server/src/test/java/com/google/gerrit/testutil/TestChanges.java index 8b5e85a22e..aa7b38bdbb 100644 --- a/gerrit-server/src/test/java/com/google/gerrit/testutil/TestChanges.java +++ b/gerrit-server/src/test/java/com/google/gerrit/testutil/TestChanges.java @@ -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)