mirror of
https://github.com/google/nomulus
synced 2026-08-18 21:26:16 +00:00
Fix all uses of DateTime.now() to use DateTimeZone.UTC
Almost all uses were in test classes, which I replaced with clock.nowUTC(). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134993149
This commit is contained in:
@@ -19,6 +19,7 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistNewRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -79,7 +80,7 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
||||
@Before
|
||||
public void before() {
|
||||
clock = new FakeClock();
|
||||
clock.setTo(DateTime.now());
|
||||
clock.setTo(DateTime.now(UTC));
|
||||
rdeImportUtils = new RdeImportUtils(ofy(), clock, "import-bucket", gcsUtils);
|
||||
createTld("test", TldState.PREDELEGATION);
|
||||
createTld("getld", TldState.GENERAL_AVAILABILITY);
|
||||
@@ -188,8 +189,8 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
||||
}
|
||||
|
||||
/** Confirms that a ForeignKeyIndex exists in the datastore for a given resource. */
|
||||
private static <T extends EppResource> void assertForeignKeyIndexFor(final T resource) {
|
||||
assertThat(ForeignKeyIndex.load(resource.getClass(), resource.getForeignKey(), DateTime.now()))
|
||||
private <T extends EppResource> void assertForeignKeyIndexFor(final T resource) {
|
||||
assertThat(ForeignKeyIndex.load(resource.getClass(), resource.getForeignKey(), clock.nowUtc()))
|
||||
.isNotNull();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user