Returns empty set of filters in MonitoringIndexNameResolver and fix tests
Original commit: elastic/x-pack-elasticsearch@e901347de9
This commit is contained in:
parent
203ad03d26
commit
d3dff6659b
|
@ -23,6 +23,7 @@ import org.joda.time.format.DateTimeFormat;
|
||||||
import org.joda.time.format.DateTimeFormatter;
|
import org.joda.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
@ -108,11 +109,11 @@ public abstract class MonitoringIndexNameResolver<T extends MonitoringDoc> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the filters used when rendering the document.
|
* @return the filters used when rendering the document.
|
||||||
* If null or empty, no filtering is applied.
|
* If empty, no filtering is applied.
|
||||||
*/
|
*/
|
||||||
public Set<String> filters() {
|
public Set<String> filters() {
|
||||||
// No filtering by default
|
// No filtering by default
|
||||||
return null;
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void buildXContent(T document, XContentBuilder builder, ToXContent.Params params) throws IOException;
|
protected abstract void buildXContent(T document, XContentBuilder builder, ToXContent.Params params) throws IOException;
|
||||||
|
|
|
@ -161,7 +161,7 @@ public abstract class MonitoringIndexNameResolverTestCase<M extends MonitoringDo
|
||||||
};
|
};
|
||||||
assertThat("source must contains default fields", sourceFields.keySet(), hasItems(commons));
|
assertThat("source must contains default fields", sourceFields.keySet(), hasItems(commons));
|
||||||
|
|
||||||
if (fields != null) {
|
if (fields != null && fields.isEmpty() == false) {
|
||||||
for (String field : fields) {
|
for (String field : fields) {
|
||||||
assertSourceField(field, sourceFields);
|
assertSourceField(field, sourceFields);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue