Support disabling NoteDb reads for tests
In I0a9eb0ad we fixed a NoteDb-specific issue where loading the default search results page caused ChangeNotes to get loaded, despite not causing changes to load from ReviewDb. Support this configuration in tests by adding a method to NotesMigration that is called in AbstractChangeNotes#load(). In production this method always returns false so the cost is negligible. Change-Id: I22622cb3c834eeb1391d5b80247beafe36fffedf
This commit is contained in:
@@ -529,6 +529,16 @@ public abstract class AbstractDaemonTest {
|
||||
atrScope.newContext(reviewDbProvider, null, anonymousUser.get()));
|
||||
}
|
||||
|
||||
protected Context disableDb() {
|
||||
notesMigration.setFailOnLoad(true);
|
||||
return atrScope.disableDb();
|
||||
}
|
||||
|
||||
protected void enableDb(Context preDisableContext) {
|
||||
notesMigration.setFailOnLoad(false);
|
||||
atrScope.set(preDisableContext);
|
||||
}
|
||||
|
||||
protected static Gson newGson() {
|
||||
return OutputFormat.JSON_COMPACT.newGson();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user