use of org.springframework.data.elasticsearch.core.document.SearchDocument in project spring-data-elasticsearch by spring-projects.
the class DocumentAdaptersUnitTests method searchResponseShouldReturnContainsValue.
// DATAES-628
@Test
public void searchResponseShouldReturnContainsValue() {
Map<String, DocumentField> fields = new LinkedHashMap<>();
fields.put("string", new DocumentField("string", Collections.singletonList("value")));
fields.put("bool", new DocumentField("bool", Arrays.asList(true, true, false)));
fields.put("null", new DocumentField("null", Collections.emptyList()));
SearchHit searchHit = new SearchHit(123, "my-id", new Text("type"), fields, null);
SearchDocument document = DocumentAdapters.from(searchHit);
assertThat(document.containsValue("value")).isTrue();
assertThat(document.containsValue(Arrays.asList(true, true, false))).isTrue();
assertThat(document.containsValue(null)).isTrue();
}
Aggregations