Add term to contact index

RDAP searches for contacts with a specific desired registrar need an additional
index term. The tests were not extensive enough to catch this particular case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172013843
This commit is contained in:
mountford 2017-10-12 14:37:16 -07:00 committed by jianglai
parent bf818a0139
commit 048ae4b4ba
2 changed files with 30 additions and 0 deletions

View file

@ -3,6 +3,7 @@
<datastore-index kind="ContactResource" ancestor="false" source="manual">
<property name="currentSponsorClientId" direction="asc"/>
<property name="deletionTime" direction="asc"/>
<property name="searchName" direction="asc"/>
</datastore-index>
<!-- For finding domain resources by registrar. -->
<datastore-index kind="DomainBase" ancestor="false" source="manual">

View file

@ -439,6 +439,20 @@ public class RdapEntitySearchActionTest {
runSuccessfulNameTestWithBlinky("Blinky*", "rdap_contact.json");
}
@Test
public void testNameMatchContact_found_wildcardSpecifyingSameRegistrar() throws Exception {
login("2-RegistrarTest");
action.registrarParam = Optional.of("2-RegistrarTest");
runSuccessfulNameTestWithBlinky("Blinky*", "rdap_contact.json");
}
@Test
public void testNameMatchContact_notFound_wildcardSpecifyingOtherRegistrar() throws Exception {
login("2-RegistrarTest");
action.registrarParam = Optional.of("2-RegistrarInact");
runNotFoundNameTest("Blinky*");
}
@Test
public void testNameMatchContact_found_wildcardBoth() throws Exception {
login("2-RegistrarTest");
@ -656,6 +670,21 @@ public class RdapEntitySearchActionTest {
runSuccessfulHandleTestWithBlinky("2-RO*", "rdap_contact.json");
}
@Test
public void testHandleMatchContact_found_wildcardSpecifyingSameRegistrar() throws Exception {
action.registrarParam = Optional.of("2-RegistrarTest");
login("2-RegistrarTest");
runSuccessfulHandleTestWithBlinky("2-RO*", "rdap_contact.json");
}
@Test
public void testHandleMatchContact_notFound_wildcardSpecifyingDifferentRegistrar()
throws Exception {
action.registrarParam = Optional.of("2-Registrar");
login("2-RegistrarTest");
runNotFoundHandleTest("2-RO*");
}
@Test
public void testHandleMatchContact_notFound_wildcard() throws Exception {
runNotFoundHandleTest("20*");