From 66fa2cc0d9dd3e01c9c53cb4bcb458ab5da85060 Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Tue, 5 Dec 2023 13:45:28 +0100 Subject: [PATCH] Fix check when adding a new MapperPlugin --- .../xpack/core/LocalStateCompositeXPackPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java index 26436e497a644..823ca00a1929d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java @@ -447,7 +447,10 @@ public void onIndexModule(IndexModule indexModule) { @Override public Function> getFieldFilter() { - List>> items = filterPlugins(MapperPlugin.class).stream().map(p -> p.getFieldFilter()).toList(); + List>> items = filterPlugins(MapperPlugin.class).stream() + .map(p -> p.getFieldFilter()) + .filter(p -> p.equals(NOOP_FIELD_FILTER) == false) + .toList(); if (items.size() > 1) { throw new UnsupportedOperationException("Only the security MapperPlugin should override this"); } else if (items.size() == 1) {