Simplify invocation of QueryPendingChecks

* Make calls to the setQuery(String) method chainable (return the
  QueryPendingChecks instance from this method)
* Add a parameterless apply method to QueryPendingChecks that delegates
  to apply(TopLevelResource.INSTANCE)

This way the call to invoke QueryPendingChecks in PendingChecksImpl
becomes a one-liner and the method that did the invocation can be
inlined.

Also add a test to invoke QueryPendingChecks via REST to make sure that
changing the return type of the setQuery(String) method in
QueryPendingChecks that is annotated with @Option is not a problem.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I14606891178e602e087d2de066ead1e1e1172bfb
3 files changed
tree: 844fa9547c058fe8a9d7b5d04f0a9f0cfa7a8d47
  1. gr-checks/
  2. java/
  3. javatests/
  4. src/
  5. BUILD
  6. LICENSE
  7. README.md
README.md

Gerrit Code Review Checks Plugin

This plugin provides a unified experience for checkers (CI systems, static analyzers, etc.) to integrate with Gerrit Code Review.