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:
Dave Borowitz
2016-04-22 12:31:38 -04:00
parent 680495c014
commit af71861280
6 changed files with 52 additions and 11 deletions

View File

@@ -42,6 +42,15 @@ public abstract class NotesMigration {
public abstract boolean writeAccounts();
/**
* Whether to fail when reading any data from NoteDb.
* <p>
* Used in conjunction with {@link #readChanges()} for tests.
*/
public boolean failOnLoad() {
return false;
}
public boolean enabled() {
return writeChanges() || readChanges()
|| writeAccounts() || readAccounts();