1
0
mirror of https://github.com/google/nomulus synced 2026-06-09 16:33:02 +00:00

Refactor bsa, dns, batch, and reporting packages to java.time (#3031)

This commit migrates the BSA, DNS, batch, and reporting packages from Joda-Time
to java.time. Key changes include:

- Updated Sleeper, Clock, and BigqueryUtils to use java.time types natively.
- Refactored models like RdeRevision and Tld to eliminate redundant Joda
  conversions, utilizing new DateTimeUtils static utilities for LocalDate.
- Improved test safety by replacing dynamic Instant.now() calls with static
  parsed constants.
- Migrated temporal arithmetic in test suites to use DateTimeUtils convenience
  methods (plusDays, minusDays).
- Updated BigqueryUtils serialization to preserve millisecond precision and
  formatting for large years, ensuring consistency with previous Joda behavior.
- Enhanced code readability by converting long concatenated strings to Java
  text blocks in LordnLogTest.
- Resolved environmental test failures in SyncRegistrarsSheetTest by
  synchronizing the FakeClock with the JPA extension.
- Updated project engineering standards (GEMINI.md) to prefer Truth's
  .hasValue() for Optional assertions.

Verified with a clean full build and all relevant test suites passing.
This commit is contained in:
Ben McIlwain
2026-05-06 17:44:40 -04:00
committed by GitHub
parent 81b3a2fc5b
commit 74f9f5d478
221 changed files with 1786 additions and 1587 deletions
@@ -89,6 +89,11 @@ public final class FakeClock implements Clock {
currentTimeMillis.addAndGet(duration.getMillis());
}
/** Advances clock by some duration. */
public void advanceBy(java.time.Duration duration) {
currentTimeMillis.addAndGet(duration.toMillis());
}
/** Sets the time to the specified instant. */
public void setTo(ReadableInstant time) {
currentTimeMillis.set(time.getMillis());