Address follow-up comments on Change 661563

Change 661563 received comments after being merged; therefore, it wasn't
possible to address them in the same change.

Add some additional @Sandboxes safeguard to the GroupsIT tests for
avoiding the configuration of the access database global capability to
influence other tests.

Also remove the explicit setting of
skipFullRefEvaluationIfAllRefsAreVisible in RefAdvertisementIT for
relying on defaults.

Release-Notes: skip
Change-Id: I8bbdaae085e9e40e47e76663d9c4a8c9f421997d
diff --git a/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java b/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java
index 1df2decc..36a9ae6 100644
--- a/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java
@@ -1329,6 +1329,7 @@
   }
 
   @Test
+  @Sandboxed
   public void pushToDeletedGroupBranchIsRejectedForAllUsersRepo() throws Exception {
     // refs/deleted-groups is only visible with ACCESS_DATABASE
     allowAccessDatabaseGlobalCapability();
@@ -1339,6 +1340,7 @@
   }
 
   @Test
+  @Sandboxed
   public void pushToGroupNamesBranchIsRejectedForAllUsersRepo() throws Exception {
     // refs/meta/group-names isn't usually available for fetch, so grant ACCESS_DATABASE
     allowAccessDatabaseGlobalCapability();
@@ -1355,6 +1357,7 @@
   }
 
   @Test
+  @Sandboxed
   public void pushToDeletedGroupsBranchForNonAllUsersRepo() throws Exception {
     assertCreateGroupBranch(project);
     String groupRef =
@@ -1487,6 +1490,7 @@
 
   @Test
   @IgnoreGroupInconsistencies
+  @Sandboxed
   public void cannotCreateGroupNamesBranch() throws Exception {
     // Use ProjectResetter to restore the group names ref
     try (ProjectResetter resetter =
@@ -1538,6 +1542,7 @@
   }
 
   @Test
+  @Sandboxed
   public void cannotDeleteDeletedGroupBranch() throws Exception {
     // refs/deleted-groups is only visible with ACCESS_DATABASE
     allowAccessDatabaseGlobalCapability();
@@ -1547,6 +1552,7 @@
   }
 
   @Test
+  @Sandboxed
   public void cannotDeleteGroupNamesBranch() throws Exception {
     // refs/meta/group-names is only visible with ACCESS_DATABASE
     allowAccessDatabaseGlobalCapability();
diff --git a/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java b/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java
index fe60362..c1e2c4f 100644
--- a/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java
+++ b/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java
@@ -247,8 +247,8 @@
   }
 
   @Test
-  @GerritConfig(name = "auth.skipFullRefEvaluationIfAllRefsAreVisible", value = "false")
-  public void uploadPackAllRefsVisibleNoRefsMetaConfig() throws Exception {
+  public void uploadPackAllRefsVisibleNoRefsMetaConfigByDefault() throws Exception {
+    assumeSkipFullRefEvaluationDefaultValue();
     projectOperations
         .project(project)
         .forUpdate()
@@ -1375,9 +1375,8 @@
   }
 
   @Test
-  @GerritConfig(name = "auth.skipFullRefEvaluationIfAllRefsAreVisible", value = "false")
-  public void advertisedReferencesOmitPrivateChangesOfOtherUsersWhenShortcutDisabled()
-      throws Exception {
+  public void advertisedReferencesOmitPrivateChangesOfOtherUsersByDefault() throws Exception {
+    assumeSkipFullRefEvaluationDefaultValue();
     projectOperations
         .project(project)
         .forUpdate()
@@ -1517,6 +1516,12 @@
     }
   }
 
+  private void assumeSkipFullRefEvaluationDefaultValue() {
+    assume()
+        .that(baseConfig.getBoolean("auth", "skipFullRefEvaluationIfAllRefsAreVisible", false))
+        .isFalse();
+  }
+
   private List<String> lsRemote(Project.NameKey p, TestAccount a) throws Exception {
     TestRepository<?> testRepository = cloneProject(p, a);
     try (Git git = testRepository.git()) {