Fixed test, take into account that Map can be the result if max_matches is 1.
This commit is contained in:
parent
18d7e32b7d
commit
c4b1a3045a
|
@ -73,8 +73,13 @@ public class MatchProcessorTests extends ESTestCase {
|
|||
assertThat(termQueryBuilder.fieldName(), equalTo("domain"));
|
||||
assertThat(termQueryBuilder.value(), equalTo("elastic.co"));
|
||||
// Check result
|
||||
Map<?, ?> entry;
|
||||
if (maxMatches == 1) {
|
||||
entry = ingestDocument.getFieldValue("entry", Map.class);
|
||||
} else {
|
||||
List<?> entries = ingestDocument.getFieldValue("entry", List.class);
|
||||
Map<?, ?> entry = (Map<?, ?>) entries.get(0);
|
||||
entry = (Map<?, ?>) entries.get(0);
|
||||
}
|
||||
assertThat(entry.size(), equalTo(3));
|
||||
assertThat(entry.get("globalRank"), equalTo(451));
|
||||
assertThat(entry.get("tldRank"), equalTo(23));
|
||||
|
|
Loading…
Reference in New Issue