Skip to content

Commit 484c3f8

Browse files
lktsmatthewabbott
authored andcommitted
Fix block loader tests for token_count (elastic#113718)
1 parent d95fdc1 commit 484c3f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapperTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public SyntheticSourceExample example(int maxValues) {
220220

221221
var textArray = values.stream().map(Value::text).toList();
222222

223-
var blockExpectedList = values.stream().map(Value::tokenCount).filter(Objects::nonNull).toList();
223+
var blockExpectedList = values.stream().map(Value::tokenCount).filter(Objects::nonNull).sorted().toList();
224224
var blockExpected = blockExpectedList.size() == 1 ? blockExpectedList.get(0) : blockExpectedList;
225225

226226
return new SyntheticSourceExample(textArray, textArray, blockExpected, this::mapping);
@@ -230,7 +230,7 @@ private record Value(String text, Integer tokenCount) {}
230230

231231
private Value generateValue() {
232232
if (rarely()) {
233-
return new Value(null, null);
233+
return new Value(null, nullValue);
234234
}
235235

236236
var text = randomList(0, 10, () -> randomAlphaOfLengthBetween(0, 10)).stream().collect(Collectors.joining(" "));

0 commit comments

Comments
 (0)