Extend CommitMessageFetcher to handle non-commit objects

CommitMessageFetcher expected to fetch for commit objects and failed
for non-commit objects.

With the advent of NoteDB, RefUpdatedEvents sometimes contain
non-commit objects. For example `refs/sequences/changes` typically
references a blob. When this ref gets updated, Gerrit sends a
corresponding RefUpdatedEvent with blobs as oldRev and newRev, which
used to trip up CommitMessageFetcher.

To avoid issues, we extend CommitMessageFetcher to work on ids of
arbitrary objects.

Add Mockito dependency for executing the associated unit-tests.

Bug: Issue 10686
Change-Id: I892b9299f73e71660b1a7d77d7f282a4f563001e
(cherry picked from commit 59135736c5bba8b432a81bcc1722576a66563f11)
4 files changed