javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java [1002:1038]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();

    // user2 can see user3 and itself
    requestScopeOperations.setApiUser(user2.id());
    codeOwnersInfo =
        queryCodeOwners(getCodeOwnersApi().query().setResolveAllUsers(true), "/foo/bar/baz.md");
    assertThat(codeOwnersInfo)
        .hasCodeOwnersThat()
        .comparingElementsUsing(hasAccountId())
        .containsExactly(user2.id(), user3.id());
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();

    // admin can see all users
    requestScopeOperations.setApiUser(admin.id());
    codeOwnersInfo =
        queryCodeOwners(getCodeOwnersApi().query().setResolveAllUsers(true), "/foo/bar/baz.md");
    assertThat(codeOwnersInfo)
        .hasCodeOwnersThat()
        .comparingElementsUsing(hasAccountId())
        .containsExactly(admin.id(), user.id(), user2.id(), user3.id());
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();

    // Query code owners with a limit, user2 can see user3 and itself
    requestScopeOperations.setApiUser(user2.id());
    codeOwnersInfo =
        queryCodeOwners(
            getCodeOwnersApi().query().setResolveAllUsers(true).withLimit(1), "/foo/bar/baz.md");
    assertThat(codeOwnersInfo).hasCodeOwnersThat().hasSize(1);
    assertThat(codeOwnersInfo)
        .hasCodeOwnersThat()
        .element(0)
        .hasAccountIdThat()
        .isAnyOf(user2.id(), user3.id());
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();
  }

  @Test
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java [1071:1107]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();

    // user2 can see user3 and itself
    requestScopeOperations.setApiUser(user2.id());
    codeOwnersInfo =
        queryCodeOwners(getCodeOwnersApi().query().setResolveAllUsers(true), "/foo/bar/baz.md");
    assertThat(codeOwnersInfo)
        .hasCodeOwnersThat()
        .comparingElementsUsing(hasAccountId())
        .containsExactly(user2.id(), user3.id());
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();

    // admin can see all users
    requestScopeOperations.setApiUser(admin.id());
    codeOwnersInfo =
        queryCodeOwners(getCodeOwnersApi().query().setResolveAllUsers(true), "/foo/bar/baz.md");
    assertThat(codeOwnersInfo)
        .hasCodeOwnersThat()
        .comparingElementsUsing(hasAccountId())
        .containsExactly(admin.id(), user.id(), user2.id(), user3.id());
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();

    // Query code owners with a limit, user2 can see user3 and itself
    requestScopeOperations.setApiUser(user2.id());
    codeOwnersInfo =
        queryCodeOwners(
            getCodeOwnersApi().query().setResolveAllUsers(true).withLimit(1), "/foo/bar/baz.md");
    assertThat(codeOwnersInfo).hasCodeOwnersThat().hasSize(1);
    assertThat(codeOwnersInfo)
        .hasCodeOwnersThat()
        .element(0)
        .hasAccountIdThat()
        .isAnyOf(user2.id(), user3.id());
    assertThat(codeOwnersInfo).hasOwnedByAllUsersThat().isTrue();
  }

  @Test
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



