mirror of
https://github.com/google/nomulus.git
synced 2025-06-05 20:17:27 +02:00
Default clientId to registry's registrar in domain lock commands
All domain locks we've processed so far are as a result of the URS process, for which the clientId is always that of the registry's registrar. So it makes sense to default to that value, while still retaining the option to specify it if required in case we ever support registrar-requested registry locks in the future. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=199350120
This commit is contained in:
parent
897690119e
commit
5c7a20797e
4 changed files with 41 additions and 3 deletions
|
@ -20,12 +20,14 @@ import static google.registry.model.eppcommon.StatusValue.SERVER_TRANSFER_PROHIB
|
|||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistNewRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.registrar.Registrar.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.Before;
|
||||
|
@ -37,6 +39,8 @@ public class UnlockDomainCommandTest extends EppToolCommandTestCase<UnlockDomain
|
|||
@Before
|
||||
public void before() {
|
||||
eppVerifier.expectSuperuser();
|
||||
persistNewRegistrar("adminreg", "Admin Registrar", Type.REAL, 693L);
|
||||
command.registryAdminClientId = "adminreg";
|
||||
}
|
||||
|
||||
private static void persistLockedDomain(String domainName) {
|
||||
|
@ -99,6 +103,15 @@ public class UnlockDomainCommandTest extends EppToolCommandTestCase<UnlockDomain
|
|||
runCommandForced("--client=NewRegistrar", "example.tld");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_defaultsToAdminRegistrar_ifUnspecified() throws Exception {
|
||||
persistLockedDomain("example.tld");
|
||||
runCommandForced("example.tld");
|
||||
eppVerifier
|
||||
.expectClientId("adminreg")
|
||||
.verifySent("domain_unlock.xml", ImmutableMap.of("DOMAIN", "example.tld"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_duplicateDomainsAreSpecified() throws Exception {
|
||||
IllegalArgumentException e =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue