mirror of
https://github.com/google/nomulus.git
synced 2025-08-05 17:28:25 +02:00
Remove unnecessary "throws" declarations
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201058582
This commit is contained in:
parent
a7256f5edd
commit
5d80f124ca
377 changed files with 2297 additions and 2373 deletions
|
@ -76,7 +76,7 @@ public class HostCheckFlowTest extends ResourceCheckFlowTestCase<HostCheckFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testTooManyIds() throws Exception {
|
||||
public void testTooManyIds() {
|
||||
setEppInput("host_check_51.xml");
|
||||
EppException thrown = assertThrows(TooManyResourceChecksException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
|
|
@ -123,7 +123,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_multipartTLDsAndInvalidHost() throws Exception {
|
||||
public void testFailure_multipartTLDsAndInvalidHost() {
|
||||
createTlds("bar.tld", "tld");
|
||||
|
||||
setEppHostCreateInputWithIps("ns1.bar.tld");
|
||||
|
@ -152,7 +152,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_subordinateNeedsIps() throws Exception {
|
||||
public void testFailure_subordinateNeedsIps() {
|
||||
setEppHostCreateInput("ns1.example.tld", null);
|
||||
createTld("tld");
|
||||
persistActiveDomain("example.tld");
|
||||
|
@ -161,7 +161,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_externalMustNotHaveIps() throws Exception {
|
||||
public void testFailure_externalMustNotHaveIps() {
|
||||
setEppHostCreateInputWithIps("ns1.example.external");
|
||||
createTld("tld");
|
||||
persistActiveDomain("example.tld");
|
||||
|
@ -170,7 +170,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_superordinateMissing() throws Exception {
|
||||
public void testFailure_superordinateMissing() {
|
||||
setEppHostCreateInput("ns1.example.tld", null);
|
||||
createTld("tld");
|
||||
SuperordinateDomainDoesNotExistException thrown =
|
||||
|
@ -179,7 +179,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_superordinateInPendingDelete() throws Exception {
|
||||
public void testFailure_superordinateInPendingDelete() {
|
||||
setEppHostCreateInputWithIps("ns1.example.tld");
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
|
@ -209,14 +209,14 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonLowerCaseHostname() throws Exception {
|
||||
public void testFailure_nonLowerCaseHostname() {
|
||||
setEppHostCreateInput("ns1.EXAMPLE.tld", null);
|
||||
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonPunyCodedHostname() throws Exception {
|
||||
public void testFailure_nonPunyCodedHostname() {
|
||||
setEppHostCreateInput("ns1.çauçalito.みんな", null);
|
||||
HostNameNotPunyCodedException thrown =
|
||||
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
|
||||
|
@ -224,21 +224,21 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonCanonicalHostname() throws Exception {
|
||||
public void testFailure_nonCanonicalHostname() {
|
||||
setEppHostCreateInput("ns1.example.tld.", null);
|
||||
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_longHostName() throws Exception {
|
||||
public void testFailure_longHostName() {
|
||||
setEppHostCreateInputWithIps("a" + Strings.repeat(".labelpart", 25) + ".tld");
|
||||
EppException thrown = assertThrows(HostNameTooLongException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_ip4AddressWithIp6Declaration() throws Exception {
|
||||
public void testFailure_ip4AddressWithIp6Declaration() {
|
||||
setEppHostCreateInput(
|
||||
"ns1.example.tld",
|
||||
"<host:addr ip=\"v4\">192.0.2.2</host:addr>\n"
|
||||
|
@ -248,8 +248,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
private void doFailingHostNameTest(String hostName, Class<? extends EppException> exception)
|
||||
throws Exception {
|
||||
private void doFailingHostNameTest(String hostName, Class<? extends EppException> exception) {
|
||||
setEppHostCreateInputWithIps(hostName);
|
||||
EppException thrown = assertThrows(exception, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
@ -286,7 +285,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_ccTldInBailiwick() throws Exception {
|
||||
public void testFailure_ccTldInBailiwick() {
|
||||
createTld("co.uk");
|
||||
setEppHostCreateInputWithIps("foo.co.uk");
|
||||
EppException thrown = assertThrows(HostNameTooShallowException.class, this::runFlow);
|
||||
|
|
|
@ -104,22 +104,21 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
public void testFailure_neverExisted() {
|
||||
ResourceDoesNotExistException thrown =
|
||||
assertThrows(ResourceDoesNotExistException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("(ns1.example.tld)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
public void testFailure_existedButWasDeleted() {
|
||||
persistDeletedHost("ns1.example.tld", clock.nowUtc().minusDays(1));
|
||||
ResourceDoesNotExistException thrown =
|
||||
assertThrows(ResourceDoesNotExistException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("(ns1.example.tld)");
|
||||
}
|
||||
|
||||
private void doFailingStatusTest(StatusValue statusValue, Class<? extends Exception> exception)
|
||||
throws Exception {
|
||||
private void doFailingStatusTest(StatusValue statusValue, Class<? extends Exception> exception) {
|
||||
persistResource(
|
||||
newHostResource("ns1.example.tld")
|
||||
.asBuilder()
|
||||
|
@ -148,7 +147,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClient() throws Exception {
|
||||
public void testFailure_unauthorizedClient() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
persistActiveHost("ns1.example.tld");
|
||||
EppException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
|
||||
|
@ -195,7 +194,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClientReadFromSuperordinate() throws Exception {
|
||||
public void testFailure_unauthorizedClientReadFromSuperordinate() {
|
||||
sessionMetadata.setClientId("TheRegistrar");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
|
@ -248,7 +247,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() throws Exception {
|
||||
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
createTld("tld");
|
||||
// Setup a transfer that should have been server approved a day ago.
|
||||
|
@ -281,7 +280,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_failfastWhenLinkedToDomain() throws Exception {
|
||||
public void testFailure_failfastWhenLinkedToDomain() {
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
|
@ -293,7 +292,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_failfastWhenLinkedToApplication() throws Exception {
|
||||
public void testFailure_failfastWhenLinkedToApplication() {
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainApplication("example.tld")
|
||||
|
@ -305,14 +304,14 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonLowerCaseHostname() throws Exception {
|
||||
public void testFailure_nonLowerCaseHostname() {
|
||||
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "NS1.EXAMPLE.NET"));
|
||||
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonPunyCodedHostname() throws Exception {
|
||||
public void testFailure_nonPunyCodedHostname() {
|
||||
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.çauçalito.tld"));
|
||||
HostNameNotPunyCodedException thrown =
|
||||
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
|
||||
|
@ -320,7 +319,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonCanonicalHostname() throws Exception {
|
||||
public void testFailure_nonCanonicalHostname() {
|
||||
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld."));
|
||||
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
|
|
@ -54,42 +54,41 @@ public class HostFlowUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_validExternalHostNameOnRegistrySuffixList_multipartTLD_tooShallow()
|
||||
throws Exception {
|
||||
public void test_validExternalHostNameOnRegistrySuffixList_multipartTLD_tooShallow() {
|
||||
assertThrows(
|
||||
HostNameTooShallowException.class, () -> validateHostName("host.co.uk").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validateHostName_hostNameTooLong() throws Exception {
|
||||
public void test_validateHostName_hostNameTooLong() {
|
||||
assertThrows(
|
||||
HostNameTooLongException.class,
|
||||
() -> validateHostName(Strings.repeat("na", 200) + ".wat.man"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validateHostName_hostNameNotLowerCase() throws Exception {
|
||||
public void test_validateHostName_hostNameNotLowerCase() {
|
||||
assertThrows(HostNameNotLowerCaseException.class, () -> validateHostName("NA.CAPS.TLD"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validateHostName_hostNameNotPunyCoded() throws Exception {
|
||||
public void test_validateHostName_hostNameNotPunyCoded() {
|
||||
assertThrows(
|
||||
HostNameNotPunyCodedException.class, () -> validateHostName("motörhead.death.metal"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validateHostName_hostNameNotNormalized() throws Exception {
|
||||
public void test_validateHostName_hostNameNotNormalized() {
|
||||
assertThrows(HostNameNotNormalizedException.class, () -> validateHostName("root.node.yeah."));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validateHostName_hostNameHasLeadingHyphen() throws Exception {
|
||||
public void test_validateHostName_hostNameHasLeadingHyphen() {
|
||||
assertThrows(InvalidHostNameException.class, () -> validateHostName("-giga.mega.tld"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_validateHostName_hostNameTooShallow() throws Exception {
|
||||
public void test_validateHostName_hostNameTooShallow() {
|
||||
assertThrows(HostNameTooShallowException.class, () -> validateHostName("domain.tld"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,14 +164,14 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonLowerCaseHostname() throws Exception {
|
||||
public void testFailure_nonLowerCaseHostname() {
|
||||
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "NS1.EXAMPLE.NET"));
|
||||
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonPunyCodedHostname() throws Exception {
|
||||
public void testFailure_nonPunyCodedHostname() {
|
||||
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.çauçalito.tld"));
|
||||
HostNameNotPunyCodedException thrown =
|
||||
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
|
||||
|
@ -179,7 +179,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonCanonicalHostname() throws Exception {
|
||||
public void testFailure_nonCanonicalHostname() {
|
||||
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld."));
|
||||
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
|
|
@ -888,14 +888,14 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_referToNonLowerCaseHostname() throws Exception {
|
||||
public void testFailure_referToNonLowerCaseHostname() {
|
||||
setEppHostUpdateInput("ns1.EXAMPLE.tld", "ns2.example.tld", null, null);
|
||||
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_renameToNonLowerCaseHostname() throws Exception {
|
||||
public void testFailure_renameToNonLowerCaseHostname() {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
setEppHostUpdateInput("ns1.example.tld", "ns2.EXAMPLE.tld", null, null);
|
||||
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
|
||||
|
@ -903,7 +903,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_referToNonPunyCodedHostname() throws Exception {
|
||||
public void testFailure_referToNonPunyCodedHostname() {
|
||||
setEppHostUpdateInput("ns1.çauçalito.tld", "ns1.sausalito.tld", null, null);
|
||||
HostNameNotPunyCodedException thrown =
|
||||
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
|
||||
|
@ -911,7 +911,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_renameToNonPunyCodedHostname() throws Exception {
|
||||
public void testFailure_renameToNonPunyCodedHostname() {
|
||||
persistActiveHost("ns1.sausalito.tld");
|
||||
setEppHostUpdateInput("ns1.sausalito.tld", "ns1.çauçalito.tld", null, null);
|
||||
HostNameNotPunyCodedException thrown =
|
||||
|
@ -920,7 +920,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_referToNonCanonicalHostname() throws Exception {
|
||||
public void testFailure_referToNonCanonicalHostname() {
|
||||
persistActiveHost("ns1.example.tld.");
|
||||
setEppHostUpdateInput("ns1.example.tld.", "ns2.example.tld", null, null);
|
||||
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
|
||||
|
@ -928,7 +928,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_renameToNonCanonicalHostname() throws Exception {
|
||||
public void testFailure_renameToNonCanonicalHostname() {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
setEppHostUpdateInput("ns1.example.tld", "ns2.example.tld.", null, null);
|
||||
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
|
||||
|
@ -1074,7 +1074,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClient() throws Exception {
|
||||
public void testFailure_unauthorizedClient() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
persistActiveHost("ns1.example.tld");
|
||||
EppException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
|
||||
|
@ -1114,7 +1114,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClientReadFromSuperordinate() throws Exception {
|
||||
public void testFailure_unauthorizedClientReadFromSuperordinate() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
|
@ -1154,7 +1154,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() throws Exception {
|
||||
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() {
|
||||
sessionMetadata.setClientId("TheRegistrar");
|
||||
createTld("tld");
|
||||
// Create a domain that will belong to NewRegistrar after cloneProjectedAtTime is called.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue