mirror of
https://github.com/google/nomulus
synced 2026-09-08 17:17:02 +00:00
Remove Ofy support from Cursor (#1672)
Cursor was originally envisioned to support arbitary ImmutableObject scopes. However, in practice only the Registry scope is used. The SQL representation of Cursor assumes that and the schema uses a composite ID with a string column for the primary key of the scope object. Without a schema migration to persist the VKey of the scope, we cannot support any ImmutableObject other than those with a primitive string primary key. Given the complexity involved and the limited use case, the scope is now explictly limited to Registry only. Also removed mapreduces that depends on Ofy keys of Cursors, and made some code quality improvement based on IntelliJ suggestions on modified files. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1672) <!-- Reviewable:end -->
This commit is contained in:
@@ -257,8 +257,8 @@ public class RdePipelineTest {
|
||||
|
||||
tm().transact(
|
||||
() -> {
|
||||
tm().put(Cursor.create(CursorType.BRDA, now, Registry.get("soy")));
|
||||
tm().put(Cursor.create(RDE_STAGING, now, Registry.get("soy")));
|
||||
tm().put(Cursor.createScoped(CursorType.BRDA, now, Registry.get("soy")));
|
||||
tm().put(Cursor.createScoped(RDE_STAGING, now, Registry.get("soy")));
|
||||
RdeRevision.saveRevision("soy", now, THIN, 0);
|
||||
RdeRevision.saveRevision("soy", now, FULL, 0);
|
||||
});
|
||||
@@ -567,7 +567,9 @@ public class RdePipelineTest {
|
||||
}
|
||||
|
||||
private static DateTime loadCursorTime(CursorType type) {
|
||||
return tm().transact(() -> tm().loadByKey(Cursor.createVKey(type, "soy")).getCursorTime());
|
||||
return tm().transact(
|
||||
() ->
|
||||
tm().loadByKey(Cursor.createScopedVKey(type, Registry.get("soy"))).getCursorTime());
|
||||
}
|
||||
|
||||
private static Function<DepositFragment, String> getXmlElement(String pattern) {
|
||||
|
||||
@@ -61,7 +61,6 @@ public class ClassPathManagerTest {
|
||||
assertThat(ClassPathManager.getClass("Modification")).isEqualTo(Modification.class);
|
||||
assertThat(ClassPathManager.getClass("AllocationToken")).isEqualTo(AllocationToken.class);
|
||||
assertThat(ClassPathManager.getClass("OneTime")).isEqualTo(OneTime.class);
|
||||
assertThat(ClassPathManager.getClass("Cursor")).isEqualTo(Cursor.class);
|
||||
assertThat(ClassPathManager.getClass("RdeRevision")).isEqualTo(RdeRevision.class);
|
||||
assertThat(ClassPathManager.getClass("HostResource")).isEqualTo(HostResource.class);
|
||||
assertThat(ClassPathManager.getClass("Recurring")).isEqualTo(Recurring.class);
|
||||
@@ -120,7 +119,6 @@ public class ClassPathManagerTest {
|
||||
assertThat(ClassPathManager.getClassName(Modification.class)).isEqualTo("Modification");
|
||||
assertThat(ClassPathManager.getClassName(AllocationToken.class)).isEqualTo("AllocationToken");
|
||||
assertThat(ClassPathManager.getClassName(OneTime.class)).isEqualTo("OneTime");
|
||||
assertThat(ClassPathManager.getClassName(Cursor.class)).isEqualTo("Cursor");
|
||||
assertThat(ClassPathManager.getClassName(RdeRevision.class)).isEqualTo("RdeRevision");
|
||||
assertThat(ClassPathManager.getClassName(HostResource.class)).isEqualTo("HostResource");
|
||||
assertThat(ClassPathManager.getClassName(Recurring.class)).isEqualTo("Recurring");
|
||||
|
||||
@@ -19,24 +19,18 @@ import static google.registry.model.common.Cursor.CursorType.BRDA;
|
||||
import static google.registry.model.common.Cursor.CursorType.RDE_UPLOAD;
|
||||
import static google.registry.model.common.Cursor.CursorType.RECURRING_BILLING;
|
||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
|
||||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.testing.DualDatabaseTest;
|
||||
import google.registry.testing.TestOfyAndSql;
|
||||
import google.registry.testing.TestSqlOnly;
|
||||
import google.registry.util.SerializeUtils;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Unit tests for {@link Cursor}. */
|
||||
@DualDatabaseTest
|
||||
public class CursorTest extends EntityTestCase {
|
||||
|
||||
public CursorTest() {
|
||||
@@ -48,7 +42,7 @@ public class CursorTest extends EntityTestCase {
|
||||
fakeClock.setTo(DateTime.parse("2010-10-17TZ"));
|
||||
}
|
||||
|
||||
@TestSqlOnly
|
||||
@Test
|
||||
void testSerializable() {
|
||||
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
|
||||
tm().transact(() -> tm().put(Cursor.createGlobal(RECURRING_BILLING, time)));
|
||||
@@ -57,22 +51,23 @@ public class CursorTest extends EntityTestCase {
|
||||
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
@Test
|
||||
void testSuccess_persistScopedCursor() {
|
||||
createTld("tld");
|
||||
Registry tld = createTld("tld");
|
||||
this.fakeClock.advanceOneMilli();
|
||||
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
|
||||
Cursor cursor = Cursor.create(RDE_UPLOAD, time, Registry.get("tld"));
|
||||
Cursor cursor = Cursor.createScoped(RDE_UPLOAD, time, tld);
|
||||
tm().transact(() -> tm().put(cursor));
|
||||
transactIfJpaTm(
|
||||
() -> {
|
||||
assertThat(tm().loadByKeyIfPresent(Cursor.createVKey(BRDA, "tld")).isPresent()).isFalse();
|
||||
assertThat(tm().loadByKey(Cursor.createVKey(RDE_UPLOAD, "tld")).getCursorTime())
|
||||
.isEqualTo(time);
|
||||
});
|
||||
tm().transact(
|
||||
() -> {
|
||||
assertThat(tm().loadByKeyIfPresent(Cursor.createScopedVKey(BRDA, tld)).isPresent())
|
||||
.isFalse();
|
||||
assertThat(tm().loadByKey(Cursor.createScopedVKey(RDE_UPLOAD, tld)).getCursorTime())
|
||||
.isEqualTo(time);
|
||||
});
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
@Test
|
||||
void testSuccess_persistGlobalCursor() {
|
||||
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
|
||||
Cursor cursor = Cursor.createGlobal(RECURRING_BILLING, time);
|
||||
@@ -81,86 +76,47 @@ public class CursorTest extends EntityTestCase {
|
||||
.isEqualTo(time);
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testIndexing() throws Exception {
|
||||
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
|
||||
tm().transact(() -> tm().put(Cursor.createGlobal(RECURRING_BILLING, time)));
|
||||
Cursor cursor = tm().transact(() -> tm().loadByKey(Cursor.createGlobalVKey(RECURRING_BILLING)));
|
||||
verifyDatastoreIndexing(cursor);
|
||||
@Test
|
||||
void testFailure_VKeyWrongScope() {
|
||||
Registry tld = createTld("tld");
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> Cursor.createGlobalVKey(RDE_UPLOAD),
|
||||
"Scope GLOBAL does not match cursor type RDE_UPLOAD");
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> Cursor.createScopedVKey(RECURRING_BILLING, tld),
|
||||
"Scope tld does not match cursor type RECURRING_BILLING");
|
||||
assertThrows(
|
||||
NullPointerException.class, () -> Cursor.createScopedVKey(RECURRING_BILLING, null));
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_invalidScopeOnCreate() {
|
||||
createTld("tld");
|
||||
this.fakeClock.advanceOneMilli();
|
||||
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
|
||||
final DomainBase domain = persistActiveDomain("notaregistry.tld");
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> Cursor.create(RDE_UPLOAD, time, domain),
|
||||
domain.getTld());
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains("Class required for cursor does not match scope class");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_invalidScopeOnKeyCreate() {
|
||||
createTld("tld");
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> Cursor.createKey(RDE_UPLOAD, persistActiveDomain("notaregistry.tld")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains("Class required for cursor does not match scope class");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_createGlobalKeyForScopedCursorType() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(IllegalArgumentException.class, () -> Cursor.createGlobalKey(RDE_UPLOAD));
|
||||
assertThat(thrown).hasMessageThat().contains("Cursor type is not a global cursor");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_invalidScopeOnGlobalKeyCreate() {
|
||||
createTld("tld");
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> Cursor.createKey(RECURRING_BILLING, persistActiveDomain("notaregistry.tld")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains("Class required for cursor does not match scope class");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
@Test
|
||||
void testFailure_nullScope() {
|
||||
NullPointerException thrown =
|
||||
assertThrows(
|
||||
NullPointerException.class,
|
||||
() -> Cursor.create(RECURRING_BILLING, START_OF_TIME, null));
|
||||
() -> Cursor.createScoped(RECURRING_BILLING, START_OF_TIME, null));
|
||||
assertThat(thrown).hasMessageThat().contains("Cursor scope cannot be null");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
@Test
|
||||
void testFailure_nullCursorType() {
|
||||
createTld("tld");
|
||||
NullPointerException thrown =
|
||||
assertThrows(
|
||||
NullPointerException.class,
|
||||
() -> Cursor.create(null, START_OF_TIME, Registry.get("tld")));
|
||||
() -> Cursor.createScoped(null, START_OF_TIME, Registry.get("tld")));
|
||||
assertThat(thrown).hasMessageThat().contains("Cursor type cannot be null");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
@Test
|
||||
void testFailure_nullTime() {
|
||||
createTld("tld");
|
||||
NullPointerException thrown =
|
||||
assertThrows(
|
||||
NullPointerException.class, () -> Cursor.create(RDE_UPLOAD, null, Registry.get("tld")));
|
||||
NullPointerException.class,
|
||||
() -> Cursor.createScoped(RDE_UPLOAD, null, Registry.get("tld")));
|
||||
assertThat(thrown).hasMessageThat().contains("Cursor time cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ class BillingVKeyTest {
|
||||
return billingRecurrenceVKey.createVKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VKey<BillingVKeyTestEntity> createVKey() {
|
||||
return VKey.createSql(BillingVKeyTestEntity.class, id);
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ class DomainHistoryVKeyTest {
|
||||
this.domainHistoryVKey = domainHistoryVKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VKey<TestEntity> createVKey() {
|
||||
return VKey.createSql(TestEntity.class, id);
|
||||
}
|
||||
|
||||
@@ -125,13 +125,13 @@ public class BrdaCopyActionTest {
|
||||
() -> {
|
||||
RdeRevision.saveRevision("lol", DateTime.parse("2010-10-17TZ"), RdeMode.THIN, 0);
|
||||
});
|
||||
persistResource(Cursor.create(BRDA, action.watermark.plusDays(1), Registry.get("lol")));
|
||||
persistResource(Cursor.createScoped(BRDA, action.watermark.plusDays(1), Registry.get("lol")));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"", "job-name/"})
|
||||
void testRun_stagingNotFinished_throws204(String prefix) throws Exception {
|
||||
persistResource(Cursor.create(BRDA, action.watermark, Registry.get("lol")));
|
||||
persistResource(Cursor.createScoped(BRDA, action.watermark, Registry.get("lol")));
|
||||
NoContentException thrown = assertThrows(NoContentException.class, () -> runAction(prefix));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
|
||||
@@ -77,12 +77,12 @@ public class EscrowTaskRunnerTest {
|
||||
void testRun_cursorIsToday_advancesCursorToTomorrow() throws Exception {
|
||||
clock.setTo(DateTime.parse("2006-06-06T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(CursorType.RDE_STAGING, DateTime.parse("2006-06-06TZ"), registry));
|
||||
Cursor.createScoped(CursorType.RDE_STAGING, DateTime.parse("2006-06-06TZ"), registry));
|
||||
runner.lockRunAndRollForward(
|
||||
task, registry, standardSeconds(30), CursorType.RDE_STAGING, standardDays(1));
|
||||
verify(task).runWithLock(DateTime.parse("2006-06-06TZ"));
|
||||
tm().clearSessionCache();
|
||||
Cursor cursor = loadByKey(Cursor.createVKey(CursorType.RDE_STAGING, registry.getTldStr()));
|
||||
Cursor cursor = loadByKey(Cursor.createScopedVKey(CursorType.RDE_STAGING, registry));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-06-07TZ"));
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class EscrowTaskRunnerTest {
|
||||
runner.lockRunAndRollForward(
|
||||
task, registry, standardSeconds(30), CursorType.RDE_STAGING, standardDays(1));
|
||||
verify(task).runWithLock(DateTime.parse("2006-06-06TZ"));
|
||||
Cursor cursor = loadByKey(Cursor.createVKey(CursorType.RDE_STAGING, "lol"));
|
||||
Cursor cursor = loadByKey(Cursor.createScopedVKey(CursorType.RDE_STAGING, registry));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-06-07TZ"));
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class EscrowTaskRunnerTest {
|
||||
void testRun_cursorInTheFuture_doesNothing() {
|
||||
clock.setTo(DateTime.parse("2006-06-06T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(CursorType.RDE_STAGING, DateTime.parse("2006-06-07TZ"), registry));
|
||||
Cursor.createScoped(CursorType.RDE_STAGING, DateTime.parse("2006-06-07TZ"), registry));
|
||||
NoContentException thrown =
|
||||
assertThrows(
|
||||
NoContentException.class,
|
||||
@@ -115,7 +115,7 @@ public class EscrowTaskRunnerTest {
|
||||
String lockName = "EscrowTaskRunner " + task.getClass().getSimpleName();
|
||||
clock.setTo(DateTime.parse("2006-06-06T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(CursorType.RDE_STAGING, DateTime.parse("2006-06-06TZ"), registry));
|
||||
Cursor.createScoped(CursorType.RDE_STAGING, DateTime.parse("2006-06-06TZ"), registry));
|
||||
runner.lockHandler = new FakeLockHandler(false);
|
||||
ServiceUnavailableException thrown =
|
||||
assertThrows(
|
||||
|
||||
@@ -101,10 +101,9 @@ public class PendingDepositCheckerTest {
|
||||
createTldWithEscrowEnabled("lol");
|
||||
clock.advanceOneMilli();
|
||||
Registry registry = Registry.get("lol");
|
||||
Truth8.assertThat(loadByKeyIfPresent(Cursor.createVKey(RDE_STAGING, registry.getTldStr())))
|
||||
.isEmpty();
|
||||
Truth8.assertThat(loadByKeyIfPresent(Cursor.createScopedVKey(RDE_STAGING, registry))).isEmpty();
|
||||
checker.getTldsAndWatermarksPendingDepositForRdeAndBrda();
|
||||
assertThat(loadByKey(Cursor.createVKey(RDE_STAGING, registry.getTldStr())).getCursorTime())
|
||||
assertThat(loadByKey(Cursor.createScopedVKey(RDE_STAGING, registry)).getCursorTime())
|
||||
.isEqualTo(DateTime.parse("2000-01-01TZ"));
|
||||
}
|
||||
|
||||
@@ -117,7 +116,7 @@ public class PendingDepositCheckerTest {
|
||||
setCursor(Registry.get("lol"), RDE_STAGING, yesterday);
|
||||
clock.advanceOneMilli();
|
||||
checker.getTldsAndWatermarksPendingDepositForRdeAndBrda();
|
||||
Cursor cursor = loadByKey(Cursor.createVKey(RDE_STAGING, "lol"));
|
||||
Cursor cursor = loadByKey(Cursor.createScopedVKey(RDE_STAGING, Registry.get("lol")));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(yesterday);
|
||||
}
|
||||
|
||||
@@ -129,9 +128,9 @@ public class PendingDepositCheckerTest {
|
||||
clock.advanceOneMilli();
|
||||
setCursor(registry, RDE_STAGING, DateTime.parse("2000-01-02TZ")); // assume rde is already done
|
||||
clock.advanceOneMilli();
|
||||
Truth8.assertThat(loadByKeyIfPresent(Cursor.createVKey(BRDA, registry.getTldStr()))).isEmpty();
|
||||
Truth8.assertThat(loadByKeyIfPresent(Cursor.createScopedVKey(BRDA, registry))).isEmpty();
|
||||
assertThat(checker.getTldsAndWatermarksPendingDepositForRdeAndBrda()).isEmpty();
|
||||
Truth8.assertThat(loadByKeyIfPresent(Cursor.createVKey(BRDA, registry.getTldStr()))).isEmpty();
|
||||
Truth8.assertThat(loadByKeyIfPresent(Cursor.createScopedVKey(BRDA, registry))).isEmpty();
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
@@ -171,7 +170,7 @@ public class PendingDepositCheckerTest {
|
||||
|
||||
private static void setCursor(
|
||||
final Registry registry, final CursorType cursorType, final DateTime value) {
|
||||
tm().transact(() -> tm().put(Cursor.create(cursorType, value, registry)));
|
||||
tm().transact(() -> tm().put(Cursor.createScoped(cursorType, value, registry)));
|
||||
}
|
||||
|
||||
private static void createTldWithEscrowEnabled(final String tld) {
|
||||
|
||||
@@ -97,6 +97,7 @@ public class RdeReportActionTest {
|
||||
private final GcsUtils gcsUtils = new GcsUtils(LocalStorageHelper.getOptions());
|
||||
private final BlobId reportFile =
|
||||
BlobId.of("tub", "test_2006-06-06_full_S1_R0-report.xml.ghostryde");
|
||||
private Registry registry;
|
||||
|
||||
private RdeReportAction createAction() {
|
||||
RdeReporter reporter = new RdeReporter();
|
||||
@@ -120,11 +121,9 @@ public class RdeReportActionTest {
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() throws Exception {
|
||||
createTld("test");
|
||||
persistResource(
|
||||
Cursor.create(RDE_REPORT, DateTime.parse("2006-06-06TZ"), Registry.get("test")));
|
||||
persistResource(
|
||||
Cursor.create(RDE_UPLOAD, DateTime.parse("2006-06-07TZ"), Registry.get("test")));
|
||||
registry = createTld("test");
|
||||
persistResource(Cursor.createScoped(RDE_REPORT, DateTime.parse("2006-06-06TZ"), registry));
|
||||
persistResource(Cursor.createScoped(RDE_UPLOAD, DateTime.parse("2006-06-07TZ"), registry));
|
||||
gcsUtils.createFromBytes(reportFile, Ghostryde.encode(REPORT_XML.read(), encryptKey));
|
||||
tm().transact(() -> RdeRevision.saveRevision("test", DateTime.parse("2006-06-06TZ"), FULL, 0));
|
||||
}
|
||||
@@ -211,7 +210,7 @@ public class RdeReportActionTest {
|
||||
}
|
||||
|
||||
void testRunWithLock_nonexistentCursor_throws204() {
|
||||
tm().transact(() -> tm().delete(Cursor.createVKey(RDE_UPLOAD, "test")));
|
||||
tm().transact(() -> tm().delete(Cursor.createScopedVKey(RDE_UPLOAD, Registry.get("test"))));
|
||||
NoContentException thrown =
|
||||
assertThrows(
|
||||
NoContentException.class, () -> createAction().runWithLock(loadRdeReportCursor()));
|
||||
@@ -225,7 +224,7 @@ public class RdeReportActionTest {
|
||||
@TestOfyAndSql
|
||||
void testRunWithLock_uploadNotFinished_throws204() {
|
||||
persistResource(
|
||||
Cursor.create(RDE_UPLOAD, DateTime.parse("2006-06-06TZ"), Registry.get("test")));
|
||||
Cursor.createScoped(RDE_UPLOAD, DateTime.parse("2006-06-06TZ"), Registry.get("test")));
|
||||
NoContentException thrown =
|
||||
assertThrows(
|
||||
NoContentException.class, () -> createAction().runWithLock(loadRdeReportCursor()));
|
||||
@@ -270,7 +269,7 @@ public class RdeReportActionTest {
|
||||
}
|
||||
|
||||
private DateTime loadRdeReportCursor() {
|
||||
return loadByKey(Cursor.createVKey(RDE_REPORT, "test")).getCursorTime();
|
||||
return loadByKey(Cursor.createScopedVKey(RDE_REPORT, registry)).getCursorTime();
|
||||
}
|
||||
|
||||
private static ImmutableMap<String, String> mapifyHeaders(Iterable<HTTPHeader> headers) {
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.joda.time.Duration;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
/** Unit tests for {@link RdeStagingAction} in Cloud SQL. */
|
||||
/** Unit tests for {@link RdeStagingAction}. */
|
||||
@DualDatabaseTest
|
||||
public class RdeStagingActionTest extends BeamActionTestBase {
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
RdeUploadAction action = createAction(uploadUrl);
|
||||
action.lazyJsch = Lazies.of(createThrowingJSchSpy(action.lazyJsch.get(), 2));
|
||||
action.runWithLock(uploadCursor);
|
||||
@@ -286,7 +286,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
RdeUploadAction action = createAction(uploadUrl);
|
||||
action.lazyJsch = Lazies.of(createThrowingJSchSpy(action.lazyJsch.get(), 3));
|
||||
RuntimeException thrown =
|
||||
@@ -300,7 +300,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
gcsUtils.delete(GHOSTRYDE_FILE_WITH_PREFIX);
|
||||
gcsUtils.delete(LENGTH_FILE_WITH_PREFIX);
|
||||
gcsUtils.delete(REPORT_FILE_WITH_PREFIX);
|
||||
@@ -320,7 +320,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
gcsUtils.delete(GHOSTRYDE_FILE_WITH_PREFIX);
|
||||
gcsUtils.delete(LENGTH_FILE_WITH_PREFIX);
|
||||
gcsUtils.delete(REPORT_FILE_WITH_PREFIX);
|
||||
@@ -345,7 +345,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
RdeUploadAction action = createAction(uploadUrl);
|
||||
action.prefix = Optional.of(JOB_PREFIX + "-job-name/");
|
||||
gcsUtils.delete(GHOSTRYDE_FILE);
|
||||
@@ -374,7 +374,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
RdeUploadAction action = createAction(uploadUrl);
|
||||
gcsUtils.delete(GHOSTRYDE_FILE);
|
||||
gcsUtils.delete(LENGTH_FILE);
|
||||
@@ -415,7 +415,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistSimpleResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistSimpleResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
BlobId ghostrydeR1FileWithPrefix =
|
||||
BlobId.of("bucket", JOB_PREFIX + "-job-name/tld_2010-10-17_full_S1_R1.xml.ghostryde");
|
||||
BlobId lengthR1FileWithPrefix =
|
||||
@@ -446,7 +446,7 @@ public class RdeUploadActionTest {
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
createAction(uploadUrl).runWithLock(uploadCursor);
|
||||
// Only verify signature for SFTP versions, since we check elsewhere that the GCS files are
|
||||
// identical to the ones sent over SFTP.
|
||||
@@ -484,7 +484,7 @@ public class RdeUploadActionTest {
|
||||
URI url = URI.create("sftp://user:password@localhost:32323/");
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-17TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
NoContentException thrown =
|
||||
assertThrows(NoContentException.class, () -> createAction(url).runWithLock(uploadCursor));
|
||||
assertThat(thrown)
|
||||
@@ -501,8 +501,8 @@ public class RdeUploadActionTest {
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
DateTime sftpCursor = uploadCursor.minusMinutes(97); // Within the 2 hour cooldown period.
|
||||
persistResource(Cursor.create(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.create(RDE_UPLOAD_SFTP, sftpCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_STAGING, stagingCursor, Registry.get("tld")));
|
||||
persistResource(Cursor.createScoped(RDE_UPLOAD_SFTP, sftpCursor, Registry.get("tld")));
|
||||
NoContentException thrown =
|
||||
assertThrows(NoContentException.class, () -> action.runWithLock(uploadCursor));
|
||||
assertThat(thrown)
|
||||
|
||||
+17
-13
@@ -105,16 +105,16 @@ class IcannReportingUploadActionTest {
|
||||
when(mockReporter.send(PAYLOAD_SUCCESS, "foo-activity-200606.csv")).thenReturn(true);
|
||||
clock.setTo(DateTime.parse("2006-07-05T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-07-01TZ"), Registry.get("tld")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-07-01TZ"), Registry.get("tld")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-07-01TZ"), Registry.get("foo")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-07-01TZ"), Registry.get("foo")));
|
||||
loggerToIntercept.addHandler(logHandler);
|
||||
}
|
||||
@@ -146,10 +146,10 @@ class IcannReportingUploadActionTest {
|
||||
void testSuccess_january() throws Exception {
|
||||
clock.setTo(DateTime.parse("2006-01-22T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-01-01TZ"), Registry.get("tld")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-01-01TZ"), Registry.get("tld")));
|
||||
gcsUtils.createFromBytes(
|
||||
BlobId.of("basin/icann/monthly/2005-12", "tld-transactions-200512.csv"), PAYLOAD_SUCCESS);
|
||||
@@ -183,7 +183,8 @@ class IcannReportingUploadActionTest {
|
||||
IcannReportingUploadAction action = createAction();
|
||||
action.run();
|
||||
tm().clearSessionCache();
|
||||
Cursor cursor = loadByKey(Cursor.createVKey(CursorType.ICANN_UPLOAD_ACTIVITY, "tld"));
|
||||
Cursor cursor =
|
||||
loadByKey(Cursor.createScopedVKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("tld")));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-08-01TZ"));
|
||||
}
|
||||
|
||||
@@ -241,7 +242,8 @@ class IcannReportingUploadActionTest {
|
||||
runTest_nonRetryableException(
|
||||
new IOException("Your IP address 25.147.130.158 is not allowed to connect"));
|
||||
tm().clearSessionCache();
|
||||
Cursor cursor = loadByKey(Cursor.createVKey(CursorType.ICANN_UPLOAD_ACTIVITY, "tld"));
|
||||
Cursor cursor =
|
||||
loadByKey(Cursor.createScopedVKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("tld")));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
}
|
||||
|
||||
@@ -251,7 +253,8 @@ class IcannReportingUploadActionTest {
|
||||
IcannReportingUploadAction action = createAction();
|
||||
action.run();
|
||||
tm().clearSessionCache();
|
||||
Cursor cursor = loadByKey(Cursor.createVKey(CursorType.ICANN_UPLOAD_ACTIVITY, "foo"));
|
||||
Cursor cursor =
|
||||
loadByKey(Cursor.createScopedVKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("foo")));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
verifyNoMoreInteractions(mockReporter);
|
||||
}
|
||||
@@ -286,7 +289,7 @@ class IcannReportingUploadActionTest {
|
||||
void testFail_fileNotFound() throws Exception {
|
||||
clock.setTo(DateTime.parse("2006-01-22T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-01-01TZ"), Registry.get("tld")));
|
||||
IcannReportingUploadAction action = createAction();
|
||||
action.run();
|
||||
@@ -302,7 +305,7 @@ class IcannReportingUploadActionTest {
|
||||
@TestOfyAndSql
|
||||
void testWarning_fileNotStagedYet() throws Exception {
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
Cursor.createScoped(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-08-01TZ"), Registry.get("foo")));
|
||||
clock.setTo(DateTime.parse("2006-08-01T00:30:00Z"));
|
||||
IcannReportingUploadAction action = createAction();
|
||||
@@ -352,9 +355,10 @@ class IcannReportingUploadActionTest {
|
||||
new InternetAddress("sender@example.com")));
|
||||
|
||||
Cursor newActivityCursor =
|
||||
loadByKey(Cursor.createVKey(CursorType.ICANN_UPLOAD_ACTIVITY, "new"));
|
||||
loadByKey(Cursor.createScopedVKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("new")));
|
||||
assertThat(newActivityCursor.getCursorTime()).isEqualTo(DateTime.parse("2006-08-01TZ"));
|
||||
Cursor newTransactionCursor = loadByKey(Cursor.createVKey(CursorType.ICANN_UPLOAD_TX, "new"));
|
||||
Cursor newTransactionCursor =
|
||||
loadByKey(Cursor.createScopedVKey(CursorType.ICANN_UPLOAD_TX, Registry.get("new")));
|
||||
assertThat(newTransactionCursor.getCursorTime()).isEqualTo(DateTime.parse("2006-08-01TZ"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,12 +388,12 @@ public class DatabaseHelper {
|
||||
}
|
||||
|
||||
/** Creates and persists a tld. */
|
||||
public static void createTld(String tld) {
|
||||
createTld(tld, GENERAL_AVAILABILITY);
|
||||
public static Registry createTld(String tld) {
|
||||
return createTld(tld, GENERAL_AVAILABILITY);
|
||||
}
|
||||
|
||||
public static void createTld(String tld, String roidSuffix) {
|
||||
createTld(tld, roidSuffix, ImmutableSortedMap.of(START_OF_TIME, GENERAL_AVAILABILITY));
|
||||
public static Registry createTld(String tld, String roidSuffix) {
|
||||
return createTld(tld, roidSuffix, ImmutableSortedMap.of(START_OF_TIME, GENERAL_AVAILABILITY));
|
||||
}
|
||||
|
||||
/** Creates and persists the given TLDs. */
|
||||
@@ -403,23 +403,25 @@ public class DatabaseHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static void createTld(String tld, TldState tldState) {
|
||||
createTld(tld, ImmutableSortedMap.of(START_OF_TIME, tldState));
|
||||
public static Registry createTld(String tld, TldState tldState) {
|
||||
return createTld(tld, ImmutableSortedMap.of(START_OF_TIME, tldState));
|
||||
}
|
||||
|
||||
public static void createTld(String tld, ImmutableSortedMap<DateTime, TldState> tldStates) {
|
||||
public static Registry createTld(String tld, ImmutableSortedMap<DateTime, TldState> tldStates) {
|
||||
// Coerce the TLD string into a valid ROID suffix.
|
||||
String roidSuffix =
|
||||
Ascii.toUpperCase(tld.replaceFirst(ACE_PREFIX_REGEX, "").replace('.', '_'))
|
||||
.replace('-', '_');
|
||||
createTld(tld, roidSuffix.length() > 8 ? roidSuffix.substring(0, 8) : roidSuffix, tldStates);
|
||||
return createTld(
|
||||
tld, roidSuffix.length() > 8 ? roidSuffix.substring(0, 8) : roidSuffix, tldStates);
|
||||
}
|
||||
|
||||
public static void createTld(
|
||||
public static Registry createTld(
|
||||
String tld, String roidSuffix, ImmutableSortedMap<DateTime, TldState> tldStates) {
|
||||
persistResource(newRegistry(tld, roidSuffix, tldStates));
|
||||
Registry registry = persistResource(newRegistry(tld, roidSuffix, tldStates));
|
||||
allowRegistrarAccess("TheRegistrar", tld);
|
||||
allowRegistrarAccess("NewRegistrar", tld);
|
||||
return registry;
|
||||
}
|
||||
|
||||
public static void deleteTld(String tld) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package google.registry.testing;
|
||||
|
||||
import google.registry.model.AppEngineEnvironment;
|
||||
import google.registry.model.annotations.DeleteAfterMigration;
|
||||
import org.junit.jupiter.api.extension.AfterEachCallback;
|
||||
import org.junit.jupiter.api.extension.BeforeEachCallback;
|
||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
@@ -37,6 +38,7 @@ import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
*
|
||||
* @see AppEngineEnvironment
|
||||
*/
|
||||
@DeleteAfterMigration
|
||||
public class DatastoreEntityExtension implements BeforeEachCallback, AfterEachCallback {
|
||||
|
||||
private final AppEngineEnvironment environment;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ListCursorsCommandTest extends CommandTestCase<ListCursorsCommand>
|
||||
void testListCursors_twoTldsOneAbsent_printsAbsentAndTimestampSorted() throws Exception {
|
||||
createTlds("foo", "bar");
|
||||
persistResource(
|
||||
Cursor.create(CursorType.BRDA, DateTime.parse("1984-12-18TZ"), Registry.get("bar")));
|
||||
Cursor.createScoped(CursorType.BRDA, DateTime.parse("1984-12-18TZ"), Registry.get("bar")));
|
||||
runCommand("--type=BRDA");
|
||||
assertThat(getStdoutAsLines())
|
||||
.containsExactly(
|
||||
|
||||
@@ -40,13 +40,12 @@ class UpdateCursorsCommandTest extends CommandTestCase<UpdateCursorsCommand> {
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
createTld("foo");
|
||||
registry = Registry.get("foo");
|
||||
registry = createTld("foo");
|
||||
}
|
||||
|
||||
void doUpdateTest() throws Exception {
|
||||
runCommandForced("--type=brda", "--timestamp=1984-12-18T00:00:00Z", "foo");
|
||||
assertThat(loadByKey(Cursor.createVKey(CursorType.BRDA, "foo")).getCursorTime())
|
||||
assertThat(loadByKey(Cursor.createScopedVKey(CursorType.BRDA, registry)).getCursorTime())
|
||||
.isEqualTo(DateTime.parse("1984-12-18TZ"));
|
||||
String changes = command.prompt();
|
||||
assertThat(changes)
|
||||
@@ -66,14 +65,13 @@ class UpdateCursorsCommandTest extends CommandTestCase<UpdateCursorsCommand> {
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_oldValueisEmpty() throws Exception {
|
||||
assertThat(loadByKeyIfPresent(Cursor.createVKey(CursorType.BRDA, registry.getTldStr())))
|
||||
.isEmpty();
|
||||
assertThat(loadByKeyIfPresent(Cursor.createScopedVKey(CursorType.BRDA, registry))).isEmpty();
|
||||
doUpdateTest();
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_hasOldValue() throws Exception {
|
||||
persistResource(Cursor.create(CursorType.BRDA, DateTime.parse("1950-12-18TZ"), registry));
|
||||
persistResource(Cursor.createScoped(CursorType.BRDA, DateTime.parse("1950-12-18TZ"), registry));
|
||||
doUpdateTest();
|
||||
}
|
||||
|
||||
@@ -92,14 +90,15 @@ class UpdateCursorsCommandTest extends CommandTestCase<UpdateCursorsCommand> {
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_multipleTlds_hasOldValue() throws Exception {
|
||||
createTld("bar");
|
||||
Registry barRegistry = createTld("bar");
|
||||
Registry registry2 = Registry.get("bar");
|
||||
persistResource(Cursor.create(CursorType.BRDA, DateTime.parse("1950-12-18TZ"), registry));
|
||||
persistResource(Cursor.create(CursorType.BRDA, DateTime.parse("1950-12-18TZ"), registry2));
|
||||
persistResource(Cursor.createScoped(CursorType.BRDA, DateTime.parse("1950-12-18TZ"), registry));
|
||||
persistResource(
|
||||
Cursor.createScoped(CursorType.BRDA, DateTime.parse("1950-12-18TZ"), registry2));
|
||||
runCommandForced("--type=brda", "--timestamp=1984-12-18T00:00:00Z", "foo", "bar");
|
||||
assertThat(loadByKey(Cursor.createVKey(CursorType.BRDA, "foo")).getCursorTime())
|
||||
assertThat(loadByKey(Cursor.createScopedVKey(CursorType.BRDA, registry)).getCursorTime())
|
||||
.isEqualTo(DateTime.parse("1984-12-18TZ"));
|
||||
assertThat(loadByKey(Cursor.createVKey(CursorType.BRDA, "bar")).getCursorTime())
|
||||
assertThat(loadByKey(Cursor.createScopedVKey(CursorType.BRDA, barRegistry)).getCursorTime())
|
||||
.isEqualTo(DateTime.parse("1984-12-18TZ"));
|
||||
String changes = command.prompt();
|
||||
assertThat(changes)
|
||||
@@ -110,13 +109,13 @@ class UpdateCursorsCommandTest extends CommandTestCase<UpdateCursorsCommand> {
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_multipleTlds_oldValueisEmpty() throws Exception {
|
||||
createTld("bar");
|
||||
assertThat(loadByKeyIfPresent(Cursor.createVKey(CursorType.BRDA, "foo"))).isEmpty();
|
||||
assertThat(loadByKeyIfPresent(Cursor.createVKey(CursorType.BRDA, "bar"))).isEmpty();
|
||||
Registry barRegistry = createTld("bar");
|
||||
assertThat(loadByKeyIfPresent(Cursor.createScopedVKey(CursorType.BRDA, registry))).isEmpty();
|
||||
assertThat(loadByKeyIfPresent(Cursor.createScopedVKey(CursorType.BRDA, barRegistry))).isEmpty();
|
||||
runCommandForced("--type=brda", "--timestamp=1984-12-18T00:00:00Z", "foo", "bar");
|
||||
assertThat(loadByKey(Cursor.createVKey(CursorType.BRDA, "foo")).getCursorTime())
|
||||
assertThat(loadByKey(Cursor.createScopedVKey(CursorType.BRDA, registry)).getCursorTime())
|
||||
.isEqualTo(DateTime.parse("1984-12-18TZ"));
|
||||
assertThat(loadByKey(Cursor.createVKey(CursorType.BRDA, "bar")).getCursorTime())
|
||||
assertThat(loadByKey(Cursor.createScopedVKey(CursorType.BRDA, barRegistry)).getCursorTime())
|
||||
.isEqualTo(DateTime.parse("1984-12-18TZ"));
|
||||
String changes = command.prompt();
|
||||
assertThat(changes)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
AllocationToken
|
||||
Cancellation
|
||||
ContactResource
|
||||
Cursor
|
||||
DomainBase
|
||||
EntityGroupRoot
|
||||
EppResourceIndex
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Cursor
|
||||
Registrar
|
||||
Registry
|
||||
ServerSecret
|
||||
|
||||
@@ -79,12 +79,6 @@ enum google.registry.model.billing.BillingEvent$RenewalPriceBehavior {
|
||||
NONPREMIUM;
|
||||
SPECIFIED;
|
||||
}
|
||||
class google.registry.model.common.Cursor {
|
||||
@Id java.lang.String id;
|
||||
@Parent com.googlecode.objectify.Key<google.registry.model.common.EntityGroupRoot> parent;
|
||||
google.registry.model.UpdateAutoTimestamp lastUpdateTime;
|
||||
org.joda.time.DateTime cursorTime;
|
||||
}
|
||||
class google.registry.model.common.EntityGroupRoot {
|
||||
@Id java.lang.String id;
|
||||
google.registry.model.UpdateAutoTimestamp updateTimestamp;
|
||||
|
||||
Reference in New Issue
Block a user