Add support for RDAP retrieval of all registrars

This CL also fixes a bug. Registrars were returned in an arbitrary order. This caused cursor-based pagination to fail. Now we always sort by registrar name (even for handle searches), and use the registrar name in the cursor, to ensure proper behavior.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182098187
This commit is contained in:
mountford 2018-01-16 12:54:46 -08:00 committed by Ben McIlwain
parent c416b3892d
commit e577d2f5e9
2 changed files with 89 additions and 13 deletions

View file

@ -851,6 +851,32 @@ public class RdapEntitySearchActionTest extends RdapSearchActionTestCase {
"Entity 9"));
}
@Test
public void testNameMatchRegistrars_cursorNavigationThroughAll() throws Exception {
createManyContactsAndRegistrars(0, 13, registrarTest);
action.subtypeParam = Optional.of("registrars");
checkCursorNavigation(
QueryType.FULL_NAME,
"*",
ImmutableList.of(
"Entity 1",
"Entity 10",
"Entity 11",
"Entity 12",
"Entity 13",
"Entity 2",
"Entity 3",
"Entity 4",
"Entity 5",
"Entity 6",
"Entity 7",
"Entity 8",
"Entity 9",
"New Registrar",
"The Registrar",
"Yes Virginia <script>"));
}
@Test
public void testNameMatchMix_truncated() throws Exception {
login("2-RegistrarTest");
@ -1241,6 +1267,32 @@ public class RdapEntitySearchActionTest extends RdapSearchActionTestCase {
verifyErrorMetrics(0);
}
@Test
public void testHandleMatchRegistrars_cursorNavigationThroughAll() throws Exception {
createManyContactsAndRegistrars(0, 13, registrarTest);
action.subtypeParam = Optional.of("registrars");
checkCursorNavigation(
QueryType.HANDLE,
"*",
ImmutableList.of(
"Entity 1",
"Entity 10",
"Entity 11",
"Entity 12",
"Entity 13",
"Entity 2",
"Entity 3",
"Entity 4",
"Entity 5",
"Entity 6",
"Entity 7",
"Entity 8",
"Entity 9",
"New Registrar",
"The Registrar",
"Yes Virginia <script>"));
}
@Test
public void testHandleMatchMix_found_truncated() throws Exception {
createManyContactsAndRegistrars(30, 0, registrarTest);