mirror of
https://github.com/google/nomulus
synced 2026-09-19 06:32:00 +00:00
Remove unnecessary "throws" declarations
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201058582
This commit is contained in:
@@ -86,13 +86,13 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
createTlds("lol", "xn--q9jyb4c", "1.test");
|
||||
inject.setStaticField(Ofy.class, "clock", clock);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_emptyQuery_returns400BadRequestWithPlainTextOutput() throws Exception {
|
||||
public void testRun_emptyQuery_returns400BadRequestWithPlainTextOutput() {
|
||||
newWhoisHttpAction("").run();
|
||||
assertThat(response.getStatus()).isEqualTo(400);
|
||||
assertThat(response.getContentType()).isEqualTo(PLAIN_TEXT_UTF_8);
|
||||
@@ -100,7 +100,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_badUrlEncoding_returns400BadRequestWithPlainTextOutput() throws Exception {
|
||||
public void testRun_badUrlEncoding_returns400BadRequestWithPlainTextOutput() {
|
||||
newWhoisHttpAction("nic.%u307F%u3093%u306A").run();
|
||||
assertThat(response.getStatus()).isEqualTo(400);
|
||||
assertThat(response.getContentType()).isEqualTo(PLAIN_TEXT_UTF_8);
|
||||
@@ -108,7 +108,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_domainNotFound_returns404StatusAndPlainTextResponse() throws Exception {
|
||||
public void testRun_domainNotFound_returns404StatusAndPlainTextResponse() {
|
||||
newWhoisHttpAction("/domain/cat.lol").run();
|
||||
assertThat(response.getStatus()).isEqualTo(404);
|
||||
assertThat(response.getContentType()).isEqualTo(PLAIN_TEXT_UTF_8);
|
||||
@@ -118,7 +118,7 @@ public class WhoisHttpActionTest {
|
||||
// todo (b/27378695): reenable or delete this test
|
||||
@Ignore
|
||||
@Test
|
||||
public void testRun_domainInTestTld_isConsideredNotFound() throws Exception {
|
||||
public void testRun_domainInTestTld_isConsideredNotFound() {
|
||||
persistResource(Registry.get("lol").asBuilder().setTldType(Registry.TldType.TEST).build());
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", Registrar.State.ACTIVE));
|
||||
@@ -138,7 +138,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_domainQueryIdn_works() throws Exception {
|
||||
public void testRun_domainQueryIdn_works() {
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", Registrar.State.ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
@@ -156,7 +156,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_wickedLineFeedForgeryInDatastore_crlfSubstitutedWithSpace() throws Exception {
|
||||
public void testRun_wickedLineFeedForgeryInDatastore_crlfSubstitutedWithSpace() {
|
||||
ContactResource trl = makeContactResource("5372808-TRL", "Eric Schmidt", "bog@cat.みんな");
|
||||
trl =
|
||||
persistResource(
|
||||
@@ -179,7 +179,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_domainOnly_works() throws Exception {
|
||||
public void testRun_domainOnly_works() {
|
||||
persistResource(makeDomainResource(
|
||||
"cat.みんな",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
|
||||
@@ -194,14 +194,14 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_hostnameOnly_works() throws Exception {
|
||||
public void testRun_hostnameOnly_works() {
|
||||
persistResource(makeHostResource("ns1.cat.みんな", "1.2.3.4"));
|
||||
newWhoisHttpAction("ns1.cat.みんな").run();
|
||||
assertThat(response.getPayload()).contains("Server Name: ns1.cat.みんな\r\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_domainQueryPunycode_works() throws Exception {
|
||||
public void testRun_domainQueryPunycode_works() {
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", Registrar.State.ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
@@ -218,7 +218,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_nameserverQuery_works() throws Exception {
|
||||
public void testRun_nameserverQuery_works() {
|
||||
persistResource(loadRegistrar("TheRegistrar").asBuilder().setUrl("http://my.fake.url").build());
|
||||
persistResource(makeHostResource("ns1.cat.lol", "1.2.3.4"));
|
||||
newWhoisHttpAction("/nameserver/ns1.cat.lol").run();
|
||||
@@ -228,14 +228,14 @@ public class WhoisHttpActionTest {
|
||||
// todo (b/27378695): reenable or delete this test
|
||||
@Ignore
|
||||
@Test
|
||||
public void testRun_nameserverQueryInTestTld_notFound() throws Exception {
|
||||
public void testRun_nameserverQueryInTestTld_notFound() {
|
||||
persistResource(makeHostResource("ns1.cat.lol", "1.2.3.4"));
|
||||
newWhoisHttpAction("/nameserver/ns1.cat.lol").run();
|
||||
assertThat(response.getPayload()).isEqualTo(loadFile("whois_action_nameserver.txt"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_lastUpdateTimestamp_isPresentInResponse() throws Exception {
|
||||
public void testRun_lastUpdateTimestamp_isPresentInResponse() {
|
||||
clock.setTo(DateTime.parse("2020-07-12T23:52:43Z"));
|
||||
persistResource(makeHostResource("ns1.cat.lol", "1.2.3.4"));
|
||||
newWhoisHttpAction("/nameserver/ns1.cat.lol").run();
|
||||
@@ -244,7 +244,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_nameserverQueryIdn_works() throws Exception {
|
||||
public void testRun_nameserverQueryIdn_works() {
|
||||
persistResource(makeHostResource("ns1.cat.みんな", "1.2.3.4"));
|
||||
newWhoisHttpAction("/nameserver/ns1.cat.みんな").run();
|
||||
assertThat(response.getPayload()).contains("ns1.cat.みんな");
|
||||
@@ -252,7 +252,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_nameserverQueryPunycode_works() throws Exception {
|
||||
public void testRun_nameserverQueryPunycode_works() {
|
||||
persistResource(makeHostResource("ns1.cat.みんな", "1.2.3.4"));
|
||||
newWhoisHttpAction("/nameserver/ns1.cat.xn--q9jyb4c").run();
|
||||
assertThat(response.getPayload()).contains("ns1.cat.みんな");
|
||||
@@ -260,7 +260,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_trailingSlashInPath_getsIgnored() throws Exception {
|
||||
public void testRun_trailingSlashInPath_getsIgnored() {
|
||||
persistResource(makeHostResource("ns1.cat.みんな", "1.2.3.4"));
|
||||
newWhoisHttpAction("/nameserver/ns1.cat.xn--q9jyb4c/").run();
|
||||
assertThat(response.getPayload()).contains("ns1.cat.みんな");
|
||||
@@ -268,7 +268,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_uppercaseDomain_ignoresCasing() throws Exception {
|
||||
public void testRun_uppercaseDomain_ignoresCasing() {
|
||||
persistResource(makeDomainResource(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Peter Murphy", "lol@cat.lol")),
|
||||
@@ -282,7 +282,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_hairyPath_getsDecoded() throws Exception {
|
||||
public void testRun_hairyPath_getsDecoded() {
|
||||
persistResource(makeDomainResource(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Peter Murphy", "lol@cat.lol")),
|
||||
@@ -297,7 +297,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_registrarLookup_works() throws Exception {
|
||||
public void testRun_registrarLookup_works() {
|
||||
Registrar registrar = persistResource(
|
||||
makeRegistrar("example", "Example Registrar, Inc.", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
@@ -308,7 +308,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_registrarLookupInPendingState_returnsNotFound() throws Exception {
|
||||
public void testRun_registrarLookupInPendingState_returnsNotFound() {
|
||||
Registrar registrar = persistResource(
|
||||
makeRegistrar("example", "Example Registrar, Inc.", Registrar.State.PENDING));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
@@ -318,7 +318,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_registrarLookupWithTestType_returnsNotFound() throws Exception {
|
||||
public void testRun_registrarLookupWithTestType_returnsNotFound() {
|
||||
Registrar registrar = persistResource(
|
||||
makeRegistrar("example", "Example Registrar, Inc.", Registrar.State.ACTIVE)
|
||||
.asBuilder().setType(Registrar.Type.TEST).setIanaIdentifier(null).build());
|
||||
@@ -329,7 +329,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_metricsLoggedForSuccessfulCommand() throws Exception {
|
||||
public void testRun_metricsLoggedForSuccessfulCommand() {
|
||||
persistResource(makeHostResource("ns1.cat.lol", "1.2.3.4"));
|
||||
WhoisHttpAction action = newWhoisHttpAction("/nameserver/ns1.cat.lol");
|
||||
action.whoisMetrics = mock(WhoisMetrics.class);
|
||||
@@ -344,7 +344,7 @@ public class WhoisHttpActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_metricsLoggedForUnsuccessfulCommand() throws Exception {
|
||||
public void testRun_metricsLoggedForUnsuccessfulCommand() {
|
||||
WhoisHttpAction action = newWhoisHttpAction("nic.%u307F%u3093%u306A");
|
||||
action.whoisMetrics = mock(WhoisMetrics.class);
|
||||
action.run();
|
||||
|
||||
Reference in New Issue
Block a user