Merge pull request #5 from rbkmoney/ft/added-party-id-search

Search party by id
This commit is contained in:
Pospolita Nikita 2020-10-27 17:54:29 +03:00 committed by GitHub
commit e9f2955939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);