Skip to content

Commit

Permalink
Fix mutator for TermsEnumRequestTests. (#89643)
Browse files Browse the repository at this point in the history
This commit fixes mutator of the field property
to avoid that it randomly generates the same value.
  • Loading branch information
slobodanadamovic authored Aug 26, 2022
1 parent cdf4e07 commit c348003
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected TermsEnumRequest doParseInstance(XContentParser parser) throws IOExcep
@Override
protected TermsEnumRequest mutateInstance(TermsEnumRequest instance) throws IOException {
List<Consumer<TermsEnumRequest>> mutators = new ArrayList<>();
mutators.add(request -> { request.field(randomAlphaOfLengthBetween(3, 10)); });
mutators.add(request -> { request.field(randomValueOtherThan(request.field(), () -> randomAlphaOfLengthBetween(3, 10))); });
mutators.add(request -> {
String[] indices = ArrayUtils.concat(instance.indices(), generateRandomStringArray(5, 10, false, false));
request.indices(indices);
Expand Down

0 comments on commit c348003

Please sign in to comment.