Create a TestRule for dagger module overrides

If modules are overriden in @Before, dagger components may get created
before the modules are overriden. This can lead to hard-to-debug test
failures due to seemingly unrelated to changes in code.

In this CL I add ModuleOverridesRule. It can be chained with other rules
to make sure it's executed before them.

Change-Id: I2952f56f2f4b1c852805e07e19774033c44d54cc
Reviewed-by: Peter Conn <>
Reviewed-by: Theresa <>
Commit-Queue: Pavel Shmakov <>
Cr-Commit-Position: refs/heads/master@{#653143}
9 files changed