ChangeReviewersByEmailIT: Use enableDb/disableDb helper methods
Callers shouldn't depend on the implementation detail of the NotesMigration, and the implementation will change soon. Change-Id: I3286ca32efa185cac5066a0c49d758fcae0949b9
This commit is contained in:
@@ -21,6 +21,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context;
|
||||
import com.google.gerrit.acceptance.PushOneCommit;
|
||||
import com.google.gerrit.acceptance.RestResponse;
|
||||
import com.google.gerrit.extensions.api.changes.AddReviewerInput;
|
||||
@@ -319,14 +320,14 @@ public class ChangeReviewersByEmailIT extends AbstractDaemonTest {
|
||||
input.state = state;
|
||||
gApi.changes().id(r.getChangeId()).addReviewer(input);
|
||||
|
||||
notesMigration.setFailOnLoadForTest(true);
|
||||
Context oldCtx = disableDb();
|
||||
try {
|
||||
ChangeInfo info =
|
||||
Iterables.getOnlyElement(
|
||||
gApi.changes().query(r.getChangeId()).withOption(DETAILED_LABELS).get());
|
||||
assertThat(info.reviewers).isEqualTo(ImmutableMap.of(state, ImmutableList.of(acc)));
|
||||
} finally {
|
||||
notesMigration.setFailOnLoadForTest(false);
|
||||
enableDb(oldCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user