mirror of
https://github.com/google/nomulus.git
synced 2025-07-13 14:35:16 +02:00
Add a boolean for when a registrar has enabled registry lock (#228)
* Add a boolean for when a registrar has enabled registry lock * enabled -> allowed * get -> is
This commit is contained in:
parent
57975898d5
commit
92f2f3274e
5 changed files with 80 additions and 0 deletions
|
@ -88,6 +88,7 @@ public class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarC
|
|||
assertThat(registrar.getCreationTime()).isIn(Range.closed(before, after));
|
||||
assertThat(registrar.getLastUpdateTime()).isEqualTo(registrar.getCreationTime());
|
||||
assertThat(registrar.getBlockPremiumNames()).isFalse();
|
||||
assertThat(registrar.isRegistryLockAllowed()).isFalse();
|
||||
assertThat(registrar.getPoNumber()).isEmpty();
|
||||
assertThat(registrar.getIcannReferralEmail()).isEqualTo("foo@bar.test");
|
||||
|
||||
|
@ -766,6 +767,50 @@ public class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarC
|
|||
assertThat(registrar.get().getBlockPremiumNames()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_registryLockAllowed() throws Exception {
|
||||
runCommandForced(
|
||||
"--name=blobio",
|
||||
"--password=some_password",
|
||||
"--registrar_type=REAL",
|
||||
"--iana_id=8",
|
||||
"--registry_lock_allowed=true",
|
||||
"--passcode=01234",
|
||||
"--icann_referral_email=foo@bar.test",
|
||||
"--street=\"123 Fake St\"",
|
||||
"--city Fakington",
|
||||
"--state MA",
|
||||
"--zip 00351",
|
||||
"--cc US",
|
||||
"clientz");
|
||||
|
||||
Optional<Registrar> registrar = Registrar.loadByClientId("clientz");
|
||||
assertThat(registrar).isPresent();
|
||||
assertThat(registrar.get().isRegistryLockAllowed()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_registryLockDisallowed() throws Exception {
|
||||
runCommandForced(
|
||||
"--name=blobio",
|
||||
"--password=some_password",
|
||||
"--registrar_type=REAL",
|
||||
"--iana_id=8",
|
||||
"--registry_lock_allowed=false",
|
||||
"--passcode=01234",
|
||||
"--icann_referral_email=foo@bar.test",
|
||||
"--street=\"123 Fake St\"",
|
||||
"--city Fakington",
|
||||
"--state MA",
|
||||
"--zip 00351",
|
||||
"--cc US",
|
||||
"clientz");
|
||||
|
||||
Optional<Registrar> registrar = Registrar.loadByClientId("clientz");
|
||||
assertThat(registrar).isPresent();
|
||||
assertThat(registrar.get().isRegistryLockAllowed()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badPhoneNumber() {
|
||||
ParameterException thrown =
|
||||
|
|
|
@ -364,6 +364,20 @@ public class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarC
|
|||
assertThat(loadRegistrar("NewRegistrar").getBlockPremiumNames()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_allowRegistryLock() throws Exception {
|
||||
assertThat(loadRegistrar("NewRegistrar").isRegistryLockAllowed()).isFalse();
|
||||
runCommandForced("--registry_lock_allowed=true", "NewRegistrar");
|
||||
assertThat(loadRegistrar("NewRegistrar").isRegistryLockAllowed()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_disallowRegistryLock() throws Exception {
|
||||
persistResource(loadRegistrar("NewRegistrar").asBuilder().setRegistryLockAllowed(true).build());
|
||||
runCommandForced("--registry_lock_allowed=false", "NewRegistrar");
|
||||
assertThat(loadRegistrar("NewRegistrar").isRegistryLockAllowed()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_unspecifiedBooleansArentChanged() throws Exception {
|
||||
persistResource(
|
||||
|
|
|
@ -409,6 +409,7 @@ class google.registry.model.registrar.Registrar {
|
|||
@Parent com.googlecode.objectify.Key<google.registry.model.common.EntityGroupRoot> parent;
|
||||
boolean blockPremiumNames;
|
||||
boolean contactsRequireSyncing;
|
||||
boolean registryLockAllowed;
|
||||
google.registry.model.CreateAutoTimestamp creationTime;
|
||||
google.registry.model.UpdateAutoTimestamp lastUpdateTime;
|
||||
google.registry.model.registrar.Registrar$State state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue