Search party by id

This commit is contained in:
NPospolita 2020-10-27 17:30:18 +03:00
parent 678ede14ee
commit 392916db6e
2 changed files with 12 additions and 0 deletions

View File

@ -65,6 +65,7 @@ public class SearchDao {
private QueryBuilder searchPartyFields(String text) {
return multiMatchQuery(text,
"id",
"email"
);
}

View File

@ -38,6 +38,17 @@ public class ReadTest extends IntegrationTestBase {
partyRepository.deleteAll();
}
@Test
public void searchByPartyId() throws TException {
givenParty(PARTY, EMAIL);
List<SearchHit> searchHits = deanonimusServiceHandler.searchParty(PARTY);
Assert.assertFalse(searchHits.isEmpty());
Assert.assertTrue(searchHits.stream()
.anyMatch(partySearchHit -> partySearchHit.getParty().getEmail().contains(EMAIL)));
}
@Test
public void searchByPartyEmail() throws TException {
givenParty(PARTY, EMAIL);