Test that code owner configs cannot be listed
This increases the test coverage for CodeOwnerConfigsInBranchCollection
from 91.7% to 100%. More importantly now all functions are covered.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ibbcc4d8590e58d7688c1b69e46d429a35627441a
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/GetCodeOwnerConfigForPathInBranchRestIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/GetCodeOwnerConfigForPathInBranchRestIT.java
index 5f5bb6a..8ae7b98 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/GetCodeOwnerConfigForPathInBranchRestIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/restapi/GetCodeOwnerConfigForPathInBranchRestIT.java
@@ -39,6 +39,17 @@
public class GetCodeOwnerConfigForPathInBranchRestIT extends AbstractCodeOwnersTest {
@Test
@GerritConfig(name = "plugin.code-owners.enableExperimentalRestEndpoints", value = "true")
+ public void cannotListCodeOwnerConfigs() throws Exception {
+ RestResponse r =
+ adminRestSession.get(
+ String.format(
+ "/projects/%s/branches/%s/code_owners.config/",
+ IdString.fromDecoded(project.get()), IdString.fromDecoded("master")));
+ r.assertNotFound();
+ }
+
+ @Test
+ @GerritConfig(name = "plugin.code-owners.enableExperimentalRestEndpoints", value = "true")
public void getCodeOwnerConfigsForInvalidPath() throws Exception {
RestResponse r =
adminRestSession.get(