Files
gerrit/javatests/com/google/gerrit/git/testing
Dave Borowitz 14e1ad52d6 Make most small tests inherit from GerritBaseTests
One of the main purposes of GerritBaseTests is a place to park the
KeyUtil#setEncoderImpl call, which avoids NPEs when calling any gwtorm
Key#toString method. Many tests pass today without this base class for
one of a few reasons:

 * They never call Key#toString, or perhaps only call it lazily on test
   failures.
 * They transitively load some other class which has setEncoderImpl in
   its static block, such as Database.
 * They are run with `bazel test` in the same JVM/classloader as another
   test class which does inherit GerritBaseTests or otherwise indirectly
   calls setEncoderImpl. (If any tests exist in this category, then they
   already fail if run singly in an IDE or with a restricted
   --test_filter.)

In order to avoid having to reason about whether a particular test does
or does not depend on setEncoderImpl, just use GerritBaseTests
consistently. This will prevent spurious test failures when we start
removing classes like Database as we cut out ReviewDb.

This change modifies all classes named *Test.java which were not
previously inheriting from any base class. Remaining tests will be fixed
in followups.

Change-Id: I32f5456d2ebc5e545cc89ad65f74139bd3506aaa
2018-11-20 12:27:40 -08:00
..