RDAP: Add event records to responses

RFC 7483 defines a way to attach events (such as registration, renewal, etc.) to domains, nameservers and entities. The ICANN Profile calls out particular events: registration, expiration, last changed and last update. This CL implements all the ICANN-defined events except last update (defined to be the last update time of the database), which doesn't make so much sense in our system.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117546838
This commit is contained in:
mountford 2016-03-18 07:55:12 -07:00 committed by Justine Tunney
parent 2293be4079
commit 68c0f4647f
32 changed files with 1089 additions and 224 deletions

View file

@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.domain.registry.testing.DatastoreHelper.createTld;
import static com.google.domain.registry.testing.DatastoreHelper.persistResource;
import static com.google.domain.registry.testing.DatastoreHelper.persistSimpleGlobalResources;
import static com.google.domain.registry.testing.FullFieldsTestEntityHelper.makeAndPersistContactResource;
import static com.google.domain.registry.testing.FullFieldsTestEntityHelper.makeContactResource;
import static com.google.domain.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
import static com.google.domain.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
@ -49,11 +50,10 @@ import javax.annotation.Nullable;
public class RdapEntitySearchActionTest {
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
@Rule public final InjectRule inject = new InjectRule();
private final FakeResponse response = new FakeResponse();
private final FakeClock clock = new FakeClock(DateTime.parse("2009-06-29T20:13:00Z"));
private final FakeClock clock = new FakeClock(DateTime.parse("2000-01-01T00:00:00Z"));
private final RdapEntitySearchAction action = new RdapEntitySearchAction();
@ -76,14 +76,16 @@ public class RdapEntitySearchActionTest {
@Before
public void setUp() throws Exception {
inject.setStaticField(Ofy.class, "clock", clock);
createTld("tld");
contact = persistResource(
makeContactResource(
"blinky",
"Blinky (赤ベイ)",
"blinky@b.tld",
ImmutableList.of("123 Blinky St", "Blinkyland")));
contact = makeAndPersistContactResource(
"blinky",
"Blinky (赤ベイ)",
"blinky@b.tld",
ImmutableList.of("123 Blinky St", "Blinkyland"),
clock.nowUtc());
// deleted
persistResource(
@ -110,7 +112,6 @@ public class RdapEntitySearchActionTest {
.build());
persistSimpleGlobalResources(makeRegistrarContacts(registrarTest));
inject.setStaticField(Ofy.class, "clock", clock);
action.clock = clock;
action.requestPath = RdapEntitySearchAction.PATH;
action.response = response;