Test that invalid hex account option is correctly handled

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ic3222d67f9b1bb8becaa068627e9423172ee8fc9
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/AbstractGetCodeOwnersForPathRestIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/AbstractGetCodeOwnersForPathRestIT.java
index cadf021..7aa024d 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/AbstractGetCodeOwnersForPathRestIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/AbstractGetCodeOwnersForPathRestIT.java
@@ -163,6 +163,15 @@
   }
 
   @Test
+  public void cannotGetCodeOwnersWithInvalidHexAccountOption() throws Exception {
+    String invalidHexOption = "INVALID";
+    RestResponse r = adminRestSession.get(getUrl(TEST_PATH, "O=" + invalidHexOption));
+    r.assertBadRequest();
+    assertThat(r.getEntityContent())
+        .isEqualTo(String.format("\"%s\" is not a valid value for \"-O\"", invalidHexOption));
+  }
+
+  @Test
   @GerritConfig(name = "plugin.code-owners.backend", value = "non-existing-backend")
   public void cannotGetCodeOwnersIfPluginConfigurationIsInvalid() throws Exception {
     RestResponse r = adminRestSession.get(getUrl(TEST_PATH));