Test that getting code owners works for anonymous user Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I6641565b42ad8ceaf7742f8d5891048706ddb1fa
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java index 1a659ae..b2d421d 100644 --- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java +++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java
@@ -114,12 +114,18 @@ @Test public void getCodeOwnersForAbsolutePath() throws Exception { - testGetCodeOwners(true); + testGetCodeOwners(/* useAbsolutePath= */ true); } @Test public void getCodeOwnersForNonAbsolutePath() throws Exception { - testGetCodeOwners(false); + testGetCodeOwners(/* useAbsolutePath= */ false); + } + + @Test + public void getCodeOwnersForAnonymousUser() throws Exception { + requestScopeOperations.setApiUserAnonymous(); + testGetCodeOwners(/* useAbsolutePath= */ true); } private void testGetCodeOwners(boolean useAbsolutePath) throws Exception {