Add factory for ChangeResource

This will allow us to inject classes that we need for the ETag
computation.

Change-Id: I0411d53c085eb271b2704fc83f6236bf2a26cc5f
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-02-16 09:33:10 +01:00
parent 6dfc1602e5
commit 398f7a5d0a
11 changed files with 50 additions and 13 deletions

View File

@@ -197,6 +197,9 @@ public abstract class AbstractDaemonTest {
@Inject
protected ChangeNoteUtil changeNoteUtil;
@Inject
protected ChangeResource.Factory changeResourceFactory;
protected TestRepository<InMemoryRepository> testRepo;
protected GerritServer server;
protected TestAccount admin;
@@ -741,6 +744,6 @@ public abstract class AbstractDaemonTest {
List<ChangeControl> ctls = changeFinder.find(
changeId, atrScope.get().getUser());
assertThat(ctls).hasSize(1);
return new ChangeResource(ctls.get(0));
return changeResourceFactory.create(ctls.get(0));
}
}