mirror of
https://github.com/google/nomulus.git
synced 2025-07-06 03:03:34 +02: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:
parent
d853e59c7f
commit
b7a2c36be8
10 changed files with 26 additions and 24 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue