Polishing.
Use synchronous API for ES test data setup to avoid threading during the bean container startup. See #636
This commit is contained in:
committed by
Greg L. Turnquist
parent
13c0dea55c
commit
83cd9e2d5a
@@ -17,6 +17,9 @@ package example.springdata.elasticsearch.conference;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
@@ -24,9 +27,6 @@ import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Oliver Gierke
|
||||
@@ -43,16 +43,4 @@ public class Conference {
|
||||
private GeoPoint location;
|
||||
private List<String> keywords;
|
||||
|
||||
// do not remove it
|
||||
public Conference() {}
|
||||
|
||||
// do not remove it - work around for lombok generated constructor for all params
|
||||
public Conference(String id, String name, String date, GeoPoint location, List<String> keywords) {
|
||||
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.date = date;
|
||||
this.location = location;
|
||||
this.keywords = keywords;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class ElasticsearchOperationsTest {
|
||||
var query = new CriteriaQuery(
|
||||
new Criteria("keywords").contains(expectedWord).and(new Criteria("date").greaterThanEqual(expectedDate)));
|
||||
|
||||
var result = operations.search(query, Conference.class, IndexCoordinates.of("conference-index"));
|
||||
var result = operations.search(query, Conference.class);
|
||||
|
||||
assertThat(result).hasSize(3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user