mirror of
https://github.com/google/nomulus.git
synced 2025-07-21 02:06:00 +02:00
Remove more unnecessary "throws" declarations
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201243722
This commit is contained in:
parent
47322b7fcd
commit
ad73f3d167
61 changed files with 318 additions and 331 deletions
|
@ -246,18 +246,18 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
|
|||
|
||||
public void assertPollMessages(
|
||||
String clientId,
|
||||
PollMessage... expected) throws Exception {
|
||||
PollMessage... expected) {
|
||||
assertPollMessagesHelper(getPollMessages(clientId), expected);
|
||||
}
|
||||
|
||||
public void assertPollMessages(
|
||||
String clientId,
|
||||
DateTime now,
|
||||
PollMessage... expected) throws Exception {
|
||||
PollMessage... expected) {
|
||||
assertPollMessagesHelper(getPollMessages(clientId, now), expected);
|
||||
}
|
||||
|
||||
public void assertPollMessages(PollMessage... expected) throws Exception {
|
||||
public void assertPollMessages(PollMessage... expected) {
|
||||
assertPollMessagesHelper(getPollMessages(), expected);
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource
|
|||
|
||||
/** Asserts the presence of a single enqueued async contact or host deletion */
|
||||
protected <T extends EppResource> void assertAsyncDeletionTaskEnqueued(
|
||||
T resource, String requestingClientId, Trid trid, boolean isSuperuser) throws Exception {
|
||||
T resource, String requestingClientId, Trid trid, boolean isSuperuser) {
|
||||
TaskMatcher expected = new TaskMatcher()
|
||||
.etaDelta(Duration.standardSeconds(75), Duration.standardSeconds(105)) // expected: 90
|
||||
.param("resourceKey", Key.create(resource).getString())
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ContactTransferApproveFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferApproveFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("contact_transfer_approve.xml");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupContactWithPendingTransfer();
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ContactTransferCancelFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferCancelFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
this.setEppInput("contact_transfer_cancel.xml");
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
setupContactWithPendingTransfer();
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ContactTransferQueryFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferQueryFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("contact_transfer_query.xml");
|
||||
clock.setTo(DateTime.parse("2000-06-10T22:00:00.0Z"));
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
|
|
|
@ -48,7 +48,7 @@ public class ContactTransferRejectFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferRejectFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("contact_transfer_reject.xml");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupContactWithPendingTransfer();
|
||||
|
|
|
@ -1845,79 +1845,79 @@ public class DomainApplicationCreateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_uppercase() throws Exception {
|
||||
public void testFailure_uppercase() {
|
||||
doFailingDomainNameTest("Example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingDomainNameTest("test_example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDash() throws Exception {
|
||||
public void testFailure_leadingDash() {
|
||||
doFailingDomainNameTest("-example.tld", LeadingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_trailingDash() throws Exception {
|
||||
public void testFailure_trailingDash() {
|
||||
doFailingDomainNameTest("example-.tld", TrailingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooLong() throws Exception {
|
||||
public void testFailure_tooLong() {
|
||||
doFailingDomainNameTest(Strings.repeat("a", 64) + ".tld", DomainLabelTooLongException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDot() throws Exception {
|
||||
public void testFailure_leadingDot() {
|
||||
doFailingDomainNameTest(".example.tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDotTld() throws Exception {
|
||||
public void testFailure_leadingDotTld() {
|
||||
doFailingDomainNameTest("foo..tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParts() throws Exception {
|
||||
public void testFailure_tooManyParts() {
|
||||
doFailingDomainNameTest("foo.example.tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooFewParts() throws Exception {
|
||||
public void testFailure_tooFewParts() {
|
||||
doFailingDomainNameTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingDomainNameTest("foo.tld", DomainNameExistsAsTldException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingDomainNameTest("FOO.TLD", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
public void testFailure_invalidPunycode() {
|
||||
doFailingDomainNameTest("xn--abcdefg.tld", InvalidPunycodeException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_dashesInThirdAndFourthPosition() throws Exception {
|
||||
public void testFailure_dashesInThirdAndFourthPosition() {
|
||||
doFailingDomainNameTest("ab--cdefg.tld", DashesInThirdAndFourthException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
public void testFailure_tldDoesNotExist() {
|
||||
doFailingDomainNameTest("foo.nosuchtld", TldDoesNotExistException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidIdnCodePoints() throws Exception {
|
||||
public void testFailure_invalidIdnCodePoints() {
|
||||
// ❤☀☆☂☻♞☯.tld
|
||||
doFailingDomainNameTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
unusedContact = persistActiveContact("unused");
|
||||
}
|
||||
|
||||
private DomainApplication persistApplication() throws Exception {
|
||||
private DomainApplication persistApplication() {
|
||||
return persistResource(
|
||||
newApplicationBuilder()
|
||||
.setContacts(
|
||||
|
@ -129,7 +129,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
return newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD");
|
||||
}
|
||||
|
||||
private DomainApplication persistNewApplication() throws Exception {
|
||||
private DomainApplication persistNewApplication() {
|
||||
return persistResource(newApplicationBuilder().build());
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
private void doSecDnsFailingTest(
|
||||
Class<? extends EppException> expectedException, String xmlFilename) throws Exception {
|
||||
Class<? extends EppException> expectedException, String xmlFilename) {
|
||||
setEppInput(xmlFilename);
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -369,30 +369,30 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsAllCannotBeFalse() throws Exception {
|
||||
public void testFailure_secDnsAllCannotBeFalse() {
|
||||
doSecDnsFailingTest(
|
||||
SecDnsAllUsageException.class, "domain_update_sunrise_dsdata_rem_all_false.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsEmptyNotAllowed() throws Exception {
|
||||
public void testFailure_secDnsEmptyNotAllowed() {
|
||||
doSecDnsFailingTest(EmptySecDnsUpdateException.class, "domain_update_sunrise_dsdata_empty.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsUrgentNotSupported() throws Exception {
|
||||
public void testFailure_secDnsUrgentNotSupported() {
|
||||
doSecDnsFailingTest(
|
||||
UrgentAttributeNotSupportedException.class, "domain_update_sunrise_dsdata_urgent.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsChangeNotSupported() throws Exception {
|
||||
public void testFailure_secDnsChangeNotSupported() {
|
||||
doSecDnsFailingTest(
|
||||
MaxSigLifeChangeNotSupportedException.class, "domain_update_sunrise_maxsiglife.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsTooManyDsRecords() throws Exception {
|
||||
public void testFailure_secDnsTooManyDsRecords() {
|
||||
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>();
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
builder.add(DelegationSignerData.create(i, 2, 3, new byte[] {0, 1, 2}));
|
||||
|
@ -437,7 +437,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_applicationDomainNameMismatch() throws Exception {
|
||||
public void testFailure_applicationDomainNameMismatch() {
|
||||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder().setFullyQualifiedDomainName("something.tld").build());
|
||||
EppException thrown = assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow);
|
||||
|
@ -462,7 +462,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientUpdateProhibited() throws Exception {
|
||||
public void testFailure_clientUpdateProhibited() {
|
||||
setEppInput("domain_update_sunrise_authinfo.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -475,7 +475,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_serverUpdateProhibited() throws Exception {
|
||||
public void testFailure_serverUpdateProhibited() {
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newApplicationBuilder()
|
||||
|
@ -486,7 +486,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
assertThat(thrown).hasMessageThat().contains("serverUpdateProhibited");
|
||||
}
|
||||
|
||||
private void doIllegalApplicationStatusTest(ApplicationStatus status) throws Exception {
|
||||
private void doIllegalApplicationStatusTest(ApplicationStatus status) {
|
||||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder().setApplicationStatus(status).build());
|
||||
EppException thrown =
|
||||
|
@ -495,22 +495,22 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_allocatedApplicationStatus() throws Exception {
|
||||
public void testFailure_allocatedApplicationStatus() {
|
||||
doIllegalApplicationStatusTest(ApplicationStatus.ALLOCATED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidApplicationStatus() throws Exception {
|
||||
public void testFailure_invalidApplicationStatus() {
|
||||
doIllegalApplicationStatusTest(ApplicationStatus.INVALID);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_rejectedApplicationStatus() throws Exception {
|
||||
public void testFailure_rejectedApplicationStatus() {
|
||||
doIllegalApplicationStatusTest(ApplicationStatus.REJECTED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingHost() throws Exception {
|
||||
public void testFailure_missingHost() {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
persistActiveContact("sh8013");
|
||||
persistActiveContact("mak21");
|
||||
|
@ -521,7 +521,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingContact() throws Exception {
|
||||
public void testFailure_missingContact() {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
persistActiveHost("ns2.example.tld");
|
||||
persistActiveContact("mak21");
|
||||
|
@ -553,7 +553,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientProhibitedStatusValue() throws Exception {
|
||||
public void testFailure_clientProhibitedStatusValue() {
|
||||
setEppInput("domain_update_sunrise_prohibited_status.xml");
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -572,7 +572,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_duplicateContactInCommand() throws Exception {
|
||||
public void testFailure_duplicateContactInCommand() {
|
||||
setEppInput("domain_update_sunrise_duplicate_contact.xml");
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -581,7 +581,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingContactType() throws Exception {
|
||||
public void testFailure_missingContactType() {
|
||||
setEppInput("domain_update_sunrise_missing_contact_type.xml");
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -591,7 +591,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClient() throws Exception {
|
||||
public void testFailure_unauthorizedClient() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
|
@ -610,7 +610,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
public void testFailure_notAuthorizedForTld() {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistReferencedEntities();
|
||||
|
@ -631,7 +631,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_sameNameserverAddedAndRemoved() throws Exception {
|
||||
public void testFailure_sameNameserverAddedAndRemoved() {
|
||||
setEppInput("domain_update_sunrise_add_remove_same_host.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -646,7 +646,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_sameContactAddedAndRemoved() throws Exception {
|
||||
public void testFailure_sameContactAddedAndRemoved() {
|
||||
setEppInput("domain_update_sunrise_add_remove_same_contact.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -663,7 +663,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_removeAdmin() throws Exception {
|
||||
public void testFailure_removeAdmin() {
|
||||
setEppInput("domain_update_sunrise_remove_admin.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -678,7 +678,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_removeTech() throws Exception {
|
||||
public void testFailure_removeTech() {
|
||||
setEppInput("domain_update_sunrise_remove_tech.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -693,7 +693,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_newRegistrantNotWhitelisted() throws Exception {
|
||||
public void testFailure_newRegistrantNotWhitelisted() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -707,7 +707,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_newNameserverNotWhitelisted() throws Exception {
|
||||
public void testFailure_newNameserverNotWhitelisted() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -734,7 +734,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldWithNameserverWhitelist_removeLastNameserver() throws Exception {
|
||||
public void testFailure_tldWithNameserverWhitelist_removeLastNameserver() {
|
||||
setEppInput("domain_update_sunrise_remove_nameserver.xml");
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
|
@ -790,7 +790,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameserverRestricted_addedNameserverDisallowed() throws Exception {
|
||||
public void testFailure_domainNameserverRestricted_addedNameserverDisallowed() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -807,7 +807,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameserverRestricted_removeLastNameserver() throws Exception {
|
||||
public void testFailure_domainNameserverRestricted_removeLastNameserver() {
|
||||
setEppInput("domain_update_sunrise_remove_nameserver.xml");
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
|
@ -868,8 +868,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_addedNameserversAllowedInTld_disallowedInDomainNameserversWhitelists()
|
||||
throws Exception {
|
||||
public void testFailure_addedNameserversAllowedInTld_disallowedInDomainNameserversWhitelists() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -888,8 +887,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_addedNameserversDisallowedInTld_AllowedInDomainNameserversWhitelists()
|
||||
throws Exception {
|
||||
public void testFailure_addedNameserversDisallowedInTld_AllowedInDomainNameserversWhitelists() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
|
|
@ -92,7 +92,7 @@ public class DomainCheckFlowTest
|
|||
}
|
||||
|
||||
@Before
|
||||
public void initCheckTest() throws Exception {
|
||||
public void initCheckTest() {
|
||||
createTld("tld", TldState.QUIET_PERIOD);
|
||||
persistResource(Registry.get("tld").asBuilder().setReservedLists(createReservedList()).build());
|
||||
}
|
||||
|
@ -366,79 +366,79 @@ public class DomainCheckFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_uppercase() throws Exception {
|
||||
public void testFailure_uppercase() {
|
||||
doFailingBadLabelTest("FOO.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingBadLabelTest("test_example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDash() throws Exception {
|
||||
public void testFailure_leadingDash() {
|
||||
doFailingBadLabelTest("-example.tld", LeadingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_trailingDash() throws Exception {
|
||||
public void testFailure_trailingDash() {
|
||||
doFailingBadLabelTest("example-.tld", TrailingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooLong() throws Exception {
|
||||
public void testFailure_tooLong() {
|
||||
doFailingBadLabelTest(Strings.repeat("a", 64) + ".tld", DomainLabelTooLongException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDot() throws Exception {
|
||||
public void testFailure_leadingDot() {
|
||||
doFailingBadLabelTest(".example.tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDotTld() throws Exception {
|
||||
public void testFailure_leadingDotTld() {
|
||||
doFailingBadLabelTest("foo..tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParts() throws Exception {
|
||||
public void testFailure_tooManyParts() {
|
||||
doFailingBadLabelTest("foo.example.tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooFewParts() throws Exception {
|
||||
public void testFailure_tooFewParts() {
|
||||
doFailingBadLabelTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingBadLabelTest("foo.tld", DomainNameExistsAsTldException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingBadLabelTest("FOO.TLD", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
public void testFailure_invalidPunycode() {
|
||||
doFailingBadLabelTest("xn--abcdefg.tld", InvalidPunycodeException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_dashesInThirdAndFourthPosition() throws Exception {
|
||||
public void testFailure_dashesInThirdAndFourthPosition() {
|
||||
doFailingBadLabelTest("ab--cdefg.tld", DashesInThirdAndFourthException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
public void testFailure_tldDoesNotExist() {
|
||||
doFailingBadLabelTest("foo.nosuchtld", TldDoesNotExistException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidIdnCodePoints() throws Exception {
|
||||
public void testFailure_invalidIdnCodePoints() {
|
||||
// ❤☀☆☂☻♞☯.tld
|
||||
doFailingBadLabelTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
|
|
@ -883,7 +883,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingClaimsNotice() throws Exception {
|
||||
public void testFailure_missingClaimsNotice() {
|
||||
persistClaimsList(ImmutableMap.of("example", CLAIMS_KEY));
|
||||
setEppInput("domain_create.xml");
|
||||
persistContactsAndHosts();
|
||||
|
@ -1634,68 +1634,68 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_uppercase() throws Exception {
|
||||
public void testFailure_uppercase() {
|
||||
doFailingDomainNameTest("Example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingDomainNameTest("test_example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDash() throws Exception {
|
||||
public void testFailure_leadingDash() {
|
||||
doFailingDomainNameTest("-example.tld", LeadingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_trailingDash() throws Exception {
|
||||
public void testFailure_trailingDash() {
|
||||
doFailingDomainNameTest("example-.tld", TrailingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooLong() throws Exception {
|
||||
public void testFailure_tooLong() {
|
||||
doFailingDomainNameTest(Strings.repeat("a", 64) + ".tld", DomainLabelTooLongException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDot() throws Exception {
|
||||
public void testFailure_leadingDot() {
|
||||
doFailingDomainNameTest(".example.tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDotTld() throws Exception {
|
||||
public void testFailure_leadingDotTld() {
|
||||
doFailingDomainNameTest("foo..tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParts() throws Exception {
|
||||
public void testFailure_tooManyParts() {
|
||||
doFailingDomainNameTest("foo.example.tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooFewParts() throws Exception {
|
||||
public void testFailure_tooFewParts() {
|
||||
doFailingDomainNameTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
public void testFailure_invalidPunycode() {
|
||||
// You don't want to know what this string (might?) mean.
|
||||
doFailingDomainNameTest("xn--uxa129t5ap4f1h1bc3p.tld", InvalidPunycodeException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_dashesInThirdAndFourthPosition() throws Exception {
|
||||
public void testFailure_dashesInThirdAndFourthPosition() {
|
||||
doFailingDomainNameTest("ab--cdefg.tld", DashesInThirdAndFourthException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
public void testFailure_tldDoesNotExist() {
|
||||
doFailingDomainNameTest("foo.nosuchtld", TldDoesNotExistException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidIdnCodePoints() throws Exception {
|
||||
public void testFailure_invalidIdnCodePoints() {
|
||||
// ❤☀☆☂☻♞☯.tld
|
||||
doFailingDomainNameTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
|
|
@ -195,8 +195,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
}
|
||||
|
||||
private void assertAutorenewClosedAndCancellationCreatedFor(
|
||||
BillingEvent.OneTime graceBillingEvent, HistoryEntry historyEntryDomainDelete)
|
||||
throws Exception {
|
||||
BillingEvent.OneTime graceBillingEvent, HistoryEntry historyEntryDomainDelete) {
|
||||
DateTime eventTime = clock.nowUtc();
|
||||
assertBillingEvents(
|
||||
createAutorenewBillingEvent("TheRegistrar").setRecurrenceEndTime(eventTime).build(),
|
||||
|
@ -212,7 +211,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
.build());
|
||||
}
|
||||
|
||||
private void assertOnlyBillingEventIsClosedAutorenew(String clientId) throws Exception {
|
||||
private void assertOnlyBillingEventIsClosedAutorenew(String clientId) {
|
||||
// There should be no billing events (even timed to when the transfer would have expired) except
|
||||
// for the now closed autorenew one.
|
||||
assertBillingEvents(
|
||||
|
|
|
@ -84,7 +84,7 @@ public class DomainTransferApproveFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferApproveFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_approve.xml");
|
||||
// Change the registry so that the renew price changes a day minus 1 millisecond before the
|
||||
// transfer (right after there will be an autorenew in the test case that has one) and then
|
||||
|
|
|
@ -63,7 +63,7 @@ public class DomainTransferCancelFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferCancelFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_cancel.xml");
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
setupDomainWithPendingTransfer("example", "tld");
|
||||
|
|
|
@ -220,7 +220,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
}
|
||||
|
||||
/** Adds a domain that has a pending transfer on it from TheRegistrar to NewRegistrar. */
|
||||
protected void setupDomainWithPendingTransfer(String label, String tld) throws Exception {
|
||||
protected void setupDomainWithPendingTransfer(String label, String tld) {
|
||||
setupDomain(label, tld);
|
||||
domain = persistWithPendingTransfer(domain);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DomainTransferQueryFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferQueryFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_query.xml");
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
setupDomainWithPendingTransfer("example", "tld");
|
||||
|
|
|
@ -66,7 +66,7 @@ public class DomainTransferRejectFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferRejectFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_reject.xml");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupDomainWithPendingTransfer("example", "tld");
|
||||
|
|
|
@ -209,8 +209,7 @@ public class DomainTransferRequestFlowTest
|
|||
Optional<Money> transferCost,
|
||||
ImmutableSet<GracePeriod> originalGracePeriods,
|
||||
boolean expectTransferBillingEvent,
|
||||
BillingEvent.Cancellation.Builder... extraExpectedBillingEvents)
|
||||
throws Exception {
|
||||
BillingEvent.Cancellation.Builder... extraExpectedBillingEvents) {
|
||||
Registry registry = Registry.get(domain.getTld());
|
||||
final HistoryEntry historyEntryTransferRequest =
|
||||
getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REQUEST);
|
||||
|
@ -668,7 +667,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_refundableFee_v06() throws Exception {
|
||||
public void testFailure_refundableFee_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -678,7 +677,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_refundableFee_v11() throws Exception {
|
||||
public void testFailure_refundableFee_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -688,7 +687,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_refundableFee_v12() throws Exception {
|
||||
public void testFailure_refundableFee_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -698,7 +697,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_gracePeriodFee_v06() throws Exception {
|
||||
public void testFailure_gracePeriodFee_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -708,7 +707,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_gracePeriodFee_v11() throws Exception {
|
||||
public void testFailure_gracePeriodFee_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -718,7 +717,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_gracePeriodFee_v12() throws Exception {
|
||||
public void testFailure_gracePeriodFee_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -728,7 +727,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_appliedFee_v06() throws Exception {
|
||||
public void testFailure_appliedFee_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -738,7 +737,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_appliedFee_v11() throws Exception {
|
||||
public void testFailure_appliedFee_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -748,7 +747,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_appliedFee_v12() throws Exception {
|
||||
public void testFailure_appliedFee_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -788,7 +787,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_multiYearPeriod() throws Exception {
|
||||
public void testFailure_multiYearPeriod() {
|
||||
setupDomain("example", "tld");
|
||||
clock.advanceOneMilli();
|
||||
EppException thrown =
|
||||
|
@ -879,7 +878,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_superuserExtension_twoYearPeriod() throws Exception {
|
||||
public void testFailure_superuserExtension_twoYearPeriod() {
|
||||
setupDomain("example", "tld");
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
clock.advanceOneMilli();
|
||||
|
@ -893,7 +892,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_superuserExtension_zeroPeriod_feeTransferExtension() throws Exception {
|
||||
public void testFailure_superuserExtension_zeroPeriod_feeTransferExtension() {
|
||||
setupDomain("example", "tld");
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
clock.advanceOneMilli();
|
||||
|
@ -950,7 +949,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
public void testFailure_notAuthorizedForTld() {
|
||||
setupDomain("example", "tld");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
|
@ -1091,7 +1090,7 @@ public class DomainTransferRequestFlowTest
|
|||
runTest("domain_transfer_request_premium.xml", UserPrivileges.SUPERUSER);
|
||||
}
|
||||
|
||||
private void runWrongCurrencyTest(Map<String, String> substitutions) throws Exception {
|
||||
private void runWrongCurrencyTest(Map<String, String> substitutions) {
|
||||
setupDomain("example", "tld");
|
||||
persistResource(
|
||||
Registry.get("tld")
|
||||
|
@ -1111,25 +1110,25 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongCurrency_v06() throws Exception {
|
||||
public void testFailure_wrongCurrency_v06() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongCurrencyTest(FEE_06_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongCurrency_v11() throws Exception {
|
||||
public void testFailure_wrongCurrency_v11() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongCurrencyTest(FEE_11_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongCurrency_v12() throws Exception {
|
||||
public void testFailure_wrongCurrency_v12() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongCurrencyTest(FEE_12_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeGivenInWrongScale_v06() throws Exception {
|
||||
public void testFailure_feeGivenInWrongScale_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1139,7 +1138,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeGivenInWrongScale_v11() throws Exception {
|
||||
public void testFailure_feeGivenInWrongScale_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1149,7 +1148,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeGivenInWrongScale_v12() throws Exception {
|
||||
public void testFailure_feeGivenInWrongScale_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1172,25 +1171,25 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongFeeAmount_v06() throws Exception {
|
||||
public void testFailure_wrongFeeAmount_v06() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongFeeAmountTest(FEE_06_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongFeeAmount_v11() throws Exception {
|
||||
public void testFailure_wrongFeeAmount_v11() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongFeeAmountTest(FEE_11_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongFeeAmount_v12() throws Exception {
|
||||
public void testFailure_wrongFeeAmount_v12() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongFeeAmountTest(FEE_12_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_premiumBlocked() throws Exception {
|
||||
public void testFailure_premiumBlocked() {
|
||||
setupDomain("rich", "example");
|
||||
// Modify the Registrar to block premium names.
|
||||
persistResource(loadRegistrar("NewRegistrar").asBuilder().setBlockPremiumNames(true).build());
|
||||
|
@ -1202,7 +1201,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_registryRequiresAcking_feeNotProvidedOnPremiumName() throws Exception {
|
||||
public void testFailure_registryRequiresAcking_feeNotProvidedOnPremiumName() {
|
||||
setupDomain("rich", "example");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1212,7 +1211,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_registrarRequiresAcking_feeNotProvidedOnPremiumName() throws Exception {
|
||||
public void testFailure_registrarRequiresAcking_feeNotProvidedOnPremiumName() {
|
||||
setupDomain("rich", "example");
|
||||
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
|
||||
persistResource(
|
||||
|
@ -1226,7 +1225,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_noAuthInfo() throws Exception {
|
||||
public void testFailure_noAuthInfo() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1236,7 +1235,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badContactPassword() throws Exception {
|
||||
public void testFailure_badContactPassword() {
|
||||
setupDomain("example", "tld");
|
||||
// Change the contact's password so it does not match the password in the file.
|
||||
contact =
|
||||
|
@ -1253,7 +1252,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badContactRepoId() throws Exception {
|
||||
public void testFailure_badContactRepoId() {
|
||||
setupDomain("example", "tld");
|
||||
// Set the contact to a different ROID, but don't persist it; this is just so the substitution
|
||||
// code above will write the wrong ROID into the file.
|
||||
|
@ -1301,7 +1300,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_pending() throws Exception {
|
||||
public void testFailure_pending() {
|
||||
setupDomain("example", "tld");
|
||||
domain =
|
||||
persistResource(
|
||||
|
@ -1323,7 +1322,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badDomainPassword() throws Exception {
|
||||
public void testFailure_badDomainPassword() {
|
||||
setupDomain("example", "tld");
|
||||
// Change the domain's password so it does not match the password in the file.
|
||||
domain =
|
||||
|
@ -1340,7 +1339,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_sponsoringClient() throws Exception {
|
||||
public void testFailure_sponsoringClient() {
|
||||
setupDomain("example", "tld");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
EppException thrown =
|
||||
|
@ -1389,7 +1388,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_periodInMonths() throws Exception {
|
||||
public void testFailure_periodInMonths() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1399,7 +1398,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientTransferProhibited() throws Exception {
|
||||
public void testFailure_clientTransferProhibited() {
|
||||
setupDomain("example", "tld");
|
||||
domain =
|
||||
persistResource(
|
||||
|
@ -1412,7 +1411,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_serverTransferProhibited() throws Exception {
|
||||
public void testFailure_serverTransferProhibited() {
|
||||
setupDomain("example", "tld");
|
||||
domain =
|
||||
persistResource(
|
||||
|
@ -1425,7 +1424,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_pendingDelete() throws Exception {
|
||||
public void testFailure_pendingDelete() {
|
||||
setupDomain("example", "tld");
|
||||
domain = persistResource(domain.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build());
|
||||
ResourceStatusProhibitsOperationException thrown =
|
||||
|
|
|
@ -255,32 +255,32 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingHostNameTest("foo bar", InvalidHostNameException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooShallowPublicSuffix() throws Exception {
|
||||
public void testFailure_tooShallowPublicSuffix() {
|
||||
doFailingHostNameTest("example.tld", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooShallowCcTld() throws Exception {
|
||||
public void testFailure_tooShallowCcTld() {
|
||||
doFailingHostNameTest("foo.co.uk", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_barePublicSuffix() throws Exception {
|
||||
public void testFailure_barePublicSuffix() {
|
||||
doFailingHostNameTest("com", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_bareCcTld() throws Exception {
|
||||
public void testFailure_bareCcTld() {
|
||||
doFailingHostNameTest("co.uk", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooShallowNewTld() throws Exception {
|
||||
public void testFailure_tooShallowNewTld() {
|
||||
doFailingHostNameTest("example.lol", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
|
|
|
@ -129,19 +129,19 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasClientDeleteProhibited() throws Exception {
|
||||
public void testFailure_existedButWasClientDeleteProhibited() {
|
||||
doFailingStatusTest(
|
||||
StatusValue.CLIENT_DELETE_PROHIBITED, ResourceStatusProhibitsOperationException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasServerDeleteProhibited() throws Exception {
|
||||
public void testFailure_existedButWasServerDeleteProhibited() {
|
||||
doFailingStatusTest(
|
||||
StatusValue.SERVER_DELETE_PROHIBITED, ResourceStatusProhibitsOperationException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasPendingDelete() throws Exception {
|
||||
public void testFailure_existedButWasPendingDelete() {
|
||||
doFailingStatusTest(
|
||||
StatusValue.PENDING_DELETE, ResourceStatusProhibitsOperationException.class);
|
||||
}
|
||||
|
|
|
@ -87,50 +87,50 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidVersion() throws Exception {
|
||||
public void testFailure_invalidVersion() {
|
||||
doFailingTest("login_invalid_version.xml", UnimplementedProtocolVersionException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidLanguage() throws Exception {
|
||||
public void testFailure_invalidLanguage() {
|
||||
doFailingTest("login_invalid_language.xml", UnsupportedLanguageException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidExtension() throws Exception {
|
||||
public void testFailure_invalidExtension() {
|
||||
doFailingTest("login_invalid_extension.xml", UnimplementedExtensionException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidTypes() throws Exception {
|
||||
public void testFailure_invalidTypes() {
|
||||
doFailingTest("login_invalid_types.xml", UnimplementedObjectServiceException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_newPassword() throws Exception {
|
||||
public void testFailure_newPassword() {
|
||||
doFailingTest("login_invalid_newpw.xml", PasswordChangesNotSupportedException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unknownRegistrar() throws Exception {
|
||||
public void testFailure_unknownRegistrar() {
|
||||
deleteResource(getRegistrarBuilder().build());
|
||||
doFailingTest("login_valid.xml", BadRegistrarClientIdException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_pendingRegistrar() throws Exception {
|
||||
public void testFailure_pendingRegistrar() {
|
||||
persistResource(getRegistrarBuilder().setState(State.PENDING).build());
|
||||
doFailingTest("login_valid.xml", RegistrarAccountNotActiveException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectPassword() throws Exception {
|
||||
public void testFailure_incorrectPassword() {
|
||||
persistResource(getRegistrarBuilder().setPassword("diff password").build());
|
||||
doFailingTest("login_valid.xml", BadRegistrarPasswordException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyFailedLogins() throws Exception {
|
||||
public void testFailure_tooManyFailedLogins() {
|
||||
persistResource(getRegistrarBuilder().setPassword("diff password").build());
|
||||
doFailingTest("login_valid.xml", BadRegistrarPasswordException.class);
|
||||
doFailingTest("login_valid.xml", BadRegistrarPasswordException.class);
|
||||
|
@ -139,7 +139,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_alreadyLoggedIn() throws Exception {
|
||||
public void testFailure_alreadyLoggedIn() {
|
||||
sessionMetadata.setClientId("something");
|
||||
doFailingTest("login_valid.xml", AlreadyLoggedInException.class);
|
||||
}
|
||||
|
|
|
@ -44,27 +44,27 @@ public class LoginFlowViaConsoleTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withoutLoginAndLinkedAccount() throws Exception {
|
||||
public void testFailure_withoutLoginAndLinkedAccount() {
|
||||
persistLinkedAccount("person@example.com", GAE_USER_ID1);
|
||||
credentials = GaeUserCredentials.forLoggedOutUser();
|
||||
doFailingTest("login_valid.xml", UserNotLoggedInException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withoutLoginAndWithoutLinkedAccount() throws Exception {
|
||||
public void testFailure_withoutLoginAndWithoutLinkedAccount() {
|
||||
credentials = GaeUserCredentials.forLoggedOutUser();
|
||||
doFailingTest("login_valid.xml", UserNotLoggedInException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withLoginAndWithoutLinkedAccount() throws Exception {
|
||||
public void testFailure_withLoginAndWithoutLinkedAccount() {
|
||||
credentials =
|
||||
GaeUserCredentials.forTestingUser(new User("person", "example.com", GAE_USER_ID1), false);
|
||||
doFailingTest("login_valid.xml", BadGaeUserIdException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withLoginAndNoMatchingLinkedAccount() throws Exception {
|
||||
public void testFailure_withLoginAndNoMatchingLinkedAccount() {
|
||||
persistLinkedAccount("joe@example.com", GAE_USER_ID2);
|
||||
credentials =
|
||||
GaeUserCredentials.forTestingUser(new User("person", "example.com", GAE_USER_ID1), false);
|
||||
|
|
|
@ -88,28 +88,28 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectClientCertificateHash() throws Exception {
|
||||
public void testFailure_incorrectClientCertificateHash() {
|
||||
persistResource(getRegistrarBuilder().build());
|
||||
credentials = new TlsCredentials(BAD_CERT, GOOD_IP, "goo.example");
|
||||
doFailingTest("login_valid.xml", BadRegistrarCertificateException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingClientCertificateHash() throws Exception {
|
||||
public void testFailure_missingClientCertificateHash() {
|
||||
persistResource(getRegistrarBuilder().build());
|
||||
credentials = new TlsCredentials(null, GOOD_IP, "goo.example");
|
||||
doFailingTest("login_valid.xml", MissingRegistrarCertificateException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_noSniAndCertRequired() throws Exception {
|
||||
public void testFailure_noSniAndCertRequired() {
|
||||
persistResource(getRegistrarBuilder().build());
|
||||
credentials = new TlsCredentials(null, GOOD_IP, null);
|
||||
doFailingTest("login_valid.xml", NoSniException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingClientIpAddress() throws Exception {
|
||||
public void testFailure_missingClientIpAddress() {
|
||||
persistResource(
|
||||
getRegistrarBuilder()
|
||||
.setIpAddressWhitelist(ImmutableList.of(
|
||||
|
@ -121,7 +121,7 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectClientIpv4Address() throws Exception {
|
||||
public void testFailure_incorrectClientIpv4Address() {
|
||||
persistResource(
|
||||
getRegistrarBuilder()
|
||||
.setIpAddressWhitelist(ImmutableList.of(
|
||||
|
@ -133,7 +133,7 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectClientIpv6Address() throws Exception {
|
||||
public void testFailure_incorrectClientIpv6Address() {
|
||||
persistResource(
|
||||
getRegistrarBuilder()
|
||||
.setIpAddressWhitelist(ImmutableList.of(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue