Fixed several parties search

This commit is contained in:
NPospolita 2020-10-28 11:34:10 +03:00
parent 392916db6e
commit 0493f47d3d
2 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import java.util.Optional;
public class Party {
@Id
@Field(type = FieldType.Keyword)
private String id;
@Field(type = FieldType.Text, analyzer = "autocomplete", searchAnalyzer = "standard")
private String email;

View File

@ -49,6 +49,19 @@ public class ReadTest extends IntegrationTestBase {
.anyMatch(partySearchHit -> partySearchHit.getParty().getEmail().contains(EMAIL)));
}
@Test
public void searchByPartyIdWithoutTokens() throws TException {
givenParty(PARTY + "-test-kek", EMAIL + "1");
givenParty(PARTY + "-test-lol", EMAIL + "2");
givenParty(PARTY + "-test-rofl", EMAIL + "3");
givenParty(PARTY + "-test-ricardo", EMAIL + "4");
givenParty(PARTY + "-test-milos", EMAIL + "5");
List<SearchHit> searchHits = deanonimusServiceHandler.searchParty(PARTY + "-test-lol");
Assert.assertEquals(1, searchHits.size());
}
@Test
public void searchByPartyEmail() throws TException {
givenParty(PARTY, EMAIL);