diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java index de85cb6ad12..47329828b00 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestTests.java @@ -64,8 +64,8 @@ public class SearchTemplateRequestTests extends AbstractWireSerializingTestCase< mutators.add(request -> request.setExplain(!request.isExplain())); mutators.add(request -> request.setSimulate(!request.isSimulate())); - mutators.add(request -> request.setRequest( - RandomSearchRequestGenerator.randomSearchRequest(SearchSourceBuilder::searchSource))); + mutators.add(request -> request.setRequest(randomValueOtherThan(request.getRequest(), + () -> RandomSearchRequestGenerator.randomSearchRequest(SearchSourceBuilder::searchSource)))); SearchTemplateRequest mutatedInstance = copyInstance(instance); Consumer mutator = randomFrom(mutators);