mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Add domain_lock nomulus command
This command is used by registry operators to apply registry locks to domain names. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=176549874
This commit is contained in:
parent
8cd3979385
commit
f041b1bac0
18 changed files with 453 additions and 35 deletions
|
@ -14,10 +14,13 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -151,7 +154,7 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
.asBuilder()
|
||||
.setStatusValues(
|
||||
ImmutableSet.of(
|
||||
StatusValue.CLIENT_RENEW_PROHIBITED, StatusValue.SERVER_UPDATE_PROHIBITED))
|
||||
StatusValue.CLIENT_RENEW_PROHIBITED, StatusValue.SERVER_TRANSFER_PROHIBITED))
|
||||
.setNameservers(nameservers)
|
||||
.build());
|
||||
|
||||
|
@ -160,6 +163,32 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
eppVerifier().verifySent("domain_update_set_statuses.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_cantUpdateRegistryLockedDomainEvenAsSuperuser() throws Exception {
|
||||
HostResource host = persistActiveHost("ns1.zdns.google");
|
||||
ImmutableSet<Key<HostResource>> nameservers = ImmutableSet.of(Key.create(host));
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(SERVER_UPDATE_PROHIBITED))
|
||||
.setNameservers(nameservers)
|
||||
.build());
|
||||
|
||||
Exception e =
|
||||
expectThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--statuses=clientRenewProhibited,serverHold",
|
||||
"--superuser",
|
||||
"example.tld"));
|
||||
assertThat(e)
|
||||
.hasMessageThat()
|
||||
.containsMatch("The domain 'example.tld' has status SERVER_UPDATE_PROHIBITED");
|
||||
eppVerifier().verifyNothingSent();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_duplicateDomains() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Duplicate arguments found");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue