Allow registrars to be completely DISABLED

Disabled registrar cannot perform any actions via EPP and cannot log in to the
registrar web console.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=239606389
This commit is contained in:
mcilwain 2019-03-21 09:07:17 -07:00 committed by jianglai
parent 06adc9739a
commit 8ae2260ed1
15 changed files with 138 additions and 46 deletions

View file

@ -1467,26 +1467,26 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
@Test
public void testFailure_suspendedRegistrarCantCreateDomain() {
persistContactsAndHosts();
persistResource(
Registrar.loadByClientId("TheRegistrar")
.get()
.asBuilder()
.setState(State.SUSPENDED)
.build());
EppException thrown =
assertThrows(RegistrarMustBeActiveForThisOperationException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
doFailingTest_invalidRegistrarState(State.SUSPENDED);
}
@Test
public void testFailure_pendingRegistrarCantCreateDomain() {
doFailingTest_invalidRegistrarState(State.PENDING);
}
@Test
public void testFailure_disabledRegistrarCantCreateDomain() {
doFailingTest_invalidRegistrarState(State.DISABLED);
}
private void doFailingTest_invalidRegistrarState(State registrarState) {
persistContactsAndHosts();
persistResource(
Registrar.loadByClientId("TheRegistrar")
.get()
.asBuilder()
.setState(State.PENDING)
.setState(registrarState)
.build());
EppException thrown =
assertThrows(RegistrarMustBeActiveForThisOperationException.class, this::runFlow);