mirror of
https://github.com/google/nomulus
synced 2026-09-02 06:07:03 +00:00
Apply registrar code change after registrar schema change is taken effect (#1254)
* Apply code change after registrar schema change is taken effect
This commit is contained in:
@@ -29,6 +29,7 @@ import static google.registry.testing.DatabaseHelper.newRegistry;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static google.registry.testing.DatabaseHelper.persistSimpleResource;
|
||||
import static google.registry.testing.DatabaseHelper.persistSimpleResources;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -414,6 +415,64 @@ class RegistrarTest extends EntityTestCase {
|
||||
IllegalArgumentException.class, () -> new Registrar.Builder().setPhonePasscode("code1"));
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_getLastExpiringCertNotificationSentDate_returnsInitialValue() {
|
||||
assertThat(registrar.getLastExpiringCertNotificationSentDate()).isEqualTo(START_OF_TIME);
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_getLastExpiringFailoverCertNotificationSentDate_returnsInitialValue() {
|
||||
assertThat(registrar.getLastExpiringFailoverCertNotificationSentDate())
|
||||
.isEqualTo(START_OF_TIME);
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_setLastExpiringCertNotificationSentDate() {
|
||||
assertThat(
|
||||
registrar
|
||||
.asBuilder()
|
||||
.setLastExpiringCertNotificationSentDate(fakeClock.nowUtc())
|
||||
.build()
|
||||
.getLastExpiringCertNotificationSentDate())
|
||||
.isEqualTo(fakeClock.nowUtc());
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_setLastExpiringCertNotificationSentDate_nullDate() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new Registrar.Builder().setLastExpiringCertNotificationSentDate(null).build());
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Registrar lastExpiringCertNotificationSentDate cannot be null");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_setLastExpiringFailoverCertNotificationSentDate() {
|
||||
assertThat(
|
||||
registrar
|
||||
.asBuilder()
|
||||
.setLastExpiringFailoverCertNotificationSentDate(fakeClock.nowUtc())
|
||||
.build()
|
||||
.getLastExpiringFailoverCertNotificationSentDate())
|
||||
.isEqualTo(fakeClock.nowUtc());
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_setLastExpiringFailoverCertNotificationSentDate_nullDate() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
new Registrar.Builder()
|
||||
.setLastExpiringFailoverCertNotificationSentDate(null)
|
||||
.build());
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Registrar lastExpiringFailoverCertNotificationSentDate cannot be null");
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_setAllowedTlds() {
|
||||
assertThat(
|
||||
|
||||
@@ -600,6 +600,8 @@ class google.registry.model.registrar.Registrar {
|
||||
java.util.Set<java.lang.String> allowedTlds;
|
||||
java.util.Set<java.lang.String> rdapBaseUrls;
|
||||
org.joda.time.DateTime lastCertificateUpdateTime;
|
||||
org.joda.time.DateTime lastExpiringCertNotificationSentDate;
|
||||
org.joda.time.DateTime lastExpiringFailoverCertNotificationSentDate;
|
||||
}
|
||||
class google.registry.model.registrar.Registrar$BillingAccountEntry {
|
||||
java.lang.String accountId;
|
||||
|
||||
Reference in New Issue
Block a user