parent
959690a64a
commit
9d96128c7e
|
@ -1435,8 +1435,15 @@ public abstract class ESRestTestCase extends ESTestCase {
|
|||
protected static void useIgnoreMultipleMatchingTemplatesWarningsHandler(Request request) throws IOException {
|
||||
RequestOptions.Builder options = request.getOptions().toBuilder();
|
||||
options.setWarningsHandler(warnings -> {
|
||||
return warnings.stream().anyMatch(message -> CREATE_INDEX_MULTIPLE_MATCHING_TEMPLATES.matcher(message).matches() ||
|
||||
PUT_TEMPLATE_MULTIPLE_MATCHING_TEMPLATES.matcher(message).matches());
|
||||
if (warnings.size() > 0) {
|
||||
boolean matches = warnings.stream().anyMatch(
|
||||
message -> CREATE_INDEX_MULTIPLE_MATCHING_TEMPLATES.matcher(message).matches() ||
|
||||
PUT_TEMPLATE_MULTIPLE_MATCHING_TEMPLATES.matcher(message).matches());
|
||||
return matches == false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
request.setOptions(options);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue