#509 - Polishing.

Move off deprecated API. Clean up unused gitignore files.
This commit is contained in:
Mark Paluch
2020-06-16 15:18:27 +02:00
parent d92e7feabc
commit 104febea4e
4 changed files with 6 additions and 44 deletions

View File

@@ -1,13 +0,0 @@
.project
.classpath
.springBeans
.settings/
target/
#IntelliJ Stuff
.idea
*.iml
##ignore local node data files for unit tests
/data
/.DS_Store

View File

@@ -1,13 +0,0 @@
.project
.classpath
.springBeans
.settings/
target/
#IntelliJ Stuff
.idea
*.iml
##ignore local node data files for unit tests
/data
/.DS_Store

View File

@@ -26,12 +26,13 @@ import java.text.SimpleDateFormat;
import org.junit.ClassRule; import org.junit.ClassRule;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.query.Criteria; import org.springframework.data.elasticsearch.core.query.Criteria;
import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import org.springframework.data.elasticsearch.core.query.CriteriaQuery;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
/** /**
@@ -57,7 +58,7 @@ public class ReactiveElasticsearchOperationsTest {
CriteriaQuery query = new CriteriaQuery( CriteriaQuery query = new CriteriaQuery(
new Criteria("keywords").contains(expectedWord).and("date").greaterThanEqual(expectedDate)); new Criteria("keywords").contains(expectedWord).and("date").greaterThanEqual(expectedDate));
operations.find(query, Conference.class) // operations.search(query, Conference.class) //
.as(StepVerifier::create) // .as(StepVerifier::create) //
.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) // .consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) // .consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
@@ -65,11 +66,11 @@ public class ReactiveElasticsearchOperationsTest {
.verifyComplete(); .verifyComplete();
} }
void verify(Conference it, String expectedWord, String expectedDate) { void verify(SearchHit<Conference> hit, String expectedWord, String expectedDate) {
assertThat(it.getKeywords()).contains(expectedWord); assertThat(hit.getContent().getKeywords()).contains(expectedWord);
try { try {
assertThat(format.parse(it.getDate())).isAfter(format.parse(expectedDate)); assertThat(format.parse(hit.getContent().getDate())).isAfter(format.parse(expectedDate));
} catch (ParseException e) { } catch (ParseException e) {
fail("o_O", e); fail("o_O", e);
} }

View File

@@ -1,13 +0,0 @@
.project
.classpath
.springBeans
.settings/
target/
#IntelliJ Stuff
.idea
*.iml
##ignore local node data files for unit tests
/data
/.DS_Store