Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid un-intended wildcard matches in ProfileIntegTests #117888

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,11 @@ public void testSuggestProfilesWithHint() throws IOException {
equalTo(profileHits4.subList(2, profileHits4.size()))
);

// Exclude profile for "*" space since that can match _all_ profiles, if the full name is a substring of "user" or the name of
// another profile
final List<Profile> nonWildcardProfiles = profiles.stream().filter(p -> false == p.user().fullName().endsWith("*")).toList();
// A record will not be included if name does not match even when it has matching hint
final Profile hintedProfile5 = randomFrom(profiles);
final Profile hintedProfile5 = randomFrom(nonWildcardProfiles);
final List<Profile> profileHits5 = Arrays.stream(
doSuggest(
Set.of(),
Expand Down