Skip to content

Commit 104febe

Browse files
committed
#509 - Polishing.
Move off deprecated API. Clean up unused gitignore files.
1 parent d92e7fe commit 104febe

File tree

4 files changed

+6
-44
lines changed

4 files changed

+6
-44
lines changed

elasticsearch/example/.gitignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

elasticsearch/reactive/.gitignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

elasticsearch/reactive/src/test/java/example/springdata/elasticsearch/conference/ReactiveElasticsearchOperationsTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
import org.junit.ClassRule;
2727
import org.junit.Test;
2828
import org.junit.runner.RunWith;
29+
2930
import org.springframework.beans.factory.annotation.Autowired;
3031
import org.springframework.boot.test.context.SpringBootTest;
3132
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
33+
import org.springframework.data.elasticsearch.core.SearchHit;
3234
import org.springframework.data.elasticsearch.core.query.Criteria;
3335
import org.springframework.data.elasticsearch.core.query.CriteriaQuery;
34-
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
3536
import org.springframework.test.context.junit4.SpringRunner;
3637

3738
/**
@@ -57,19 +58,19 @@ public void textSearch() {
5758
CriteriaQuery query = new CriteriaQuery(
5859
new Criteria("keywords").contains(expectedWord).and("date").greaterThanEqual(expectedDate));
5960

60-
operations.find(query, Conference.class) //
61+
operations.search(query, Conference.class) //
6162
.as(StepVerifier::create) //
6263
.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
6364
.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
6465
.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
6566
.verifyComplete();
6667
}
6768

68-
void verify(Conference it, String expectedWord, String expectedDate) {
69+
void verify(SearchHit<Conference> hit, String expectedWord, String expectedDate) {
6970

70-
assertThat(it.getKeywords()).contains(expectedWord);
71+
assertThat(hit.getContent().getKeywords()).contains(expectedWord);
7172
try {
72-
assertThat(format.parse(it.getDate())).isAfter(format.parse(expectedDate));
73+
assertThat(format.parse(hit.getContent().getDate())).isAfter(format.parse(expectedDate));
7374
} catch (ParseException e) {
7475
fail("o_O", e);
7576
}

elasticsearch/rest/.gitignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)