Remove unnecessary "throws" declarations

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201058582
This commit is contained in:
mcilwain 2018-06-18 14:25:42 -07:00 committed by Ben McIlwain
parent a7256f5edd
commit 5d80f124ca
377 changed files with 2297 additions and 2373 deletions

View file

@ -61,7 +61,7 @@ public class CreateGroupsActionTest {
}
@Test
public void test_invalidRequest_missingClientId() throws Exception {
public void test_invalidRequest_missingClientId() {
BadRequestException thrown = assertThrows(BadRequestException.class, () -> runAction(null));
assertThat(thrown)
.hasMessageThat()
@ -69,7 +69,7 @@ public class CreateGroupsActionTest {
}
@Test
public void test_invalidRequest_invalidClientId() throws Exception {
public void test_invalidRequest_invalidClientId() {
BadRequestException thrown =
assertThrows(BadRequestException.class, () -> runAction("completelyMadeUpClientId"));
assertThat(thrown)

View file

@ -44,7 +44,7 @@ public class CreatePremiumListActionTest {
FakeJsonResponse response;
@Before
public void init() throws Exception {
public void init() {
createTlds("foo", "xn--q9jyb4c", "how");
deletePremiumList(PremiumList.getUncached("foo").get());
action = new CreatePremiumListAction();
@ -53,14 +53,14 @@ public class CreatePremiumListActionTest {
}
@Test
public void test_invalidRequest_missingInput_returnsErrorStatus() throws Exception {
public void test_invalidRequest_missingInput_returnsErrorStatus() {
action.name = "foo";
action.run();
assertThat(response.getResponseMap().get("status")).isEqualTo("error");
}
@Test
public void test_invalidRequest_listAlreadyExists_returnsErrorStatus() throws Exception {
public void test_invalidRequest_listAlreadyExists_returnsErrorStatus() {
action.name = "how";
action.inputData = "richer,JPY 5000";
action.run();
@ -72,7 +72,7 @@ public class CreatePremiumListActionTest {
}
@Test
public void test_nonExistentTld_successWithOverride() throws Exception {
public void test_nonExistentTld_successWithOverride() {
action.name = "zanzibar";
action.inputData = "zanzibar,USD 100";
action.override = true;
@ -82,7 +82,7 @@ public class CreatePremiumListActionTest {
}
@Test
public void test_success() throws Exception {
public void test_success() {
action.name = "foo";
action.inputData = "rich,USD 25\nricher,USD 1000\n";
action.run();

View file

@ -42,12 +42,12 @@ public class DeleteEntityActionTest {
DeleteEntityAction action = new DeleteEntityAction();
@Before
public void init() throws Exception {
public void init() {
action.response = response;
}
@Test
public void test_deleteSingleRawEntitySuccessfully() throws Exception {
public void test_deleteSingleRawEntitySuccessfully() {
Entity entity = new Entity("single", "raw");
getDatastoreService().put(entity);
action.rawKeys = KeyFactory.keyToString(entity.getKey());
@ -57,7 +57,7 @@ public class DeleteEntityActionTest {
}
@Test
public void test_deleteSingleRegisteredEntitySuccessfully() throws Exception {
public void test_deleteSingleRegisteredEntitySuccessfully() {
ReservedList ofyEntity = new ReservedList.Builder().setName("foo").build();
ofy().saveWithoutBackup().entity(ofyEntity).now();
action.rawKeys = KeyFactory.keyToString(create(ofyEntity).getRaw());
@ -67,7 +67,7 @@ public class DeleteEntityActionTest {
}
@Test
public void test_deleteOneRawEntityAndOneRegisteredEntitySuccessfully() throws Exception {
public void test_deleteOneRawEntityAndOneRegisteredEntitySuccessfully() {
Entity entity = new Entity("first", "raw");
getDatastoreService().put(entity);
String rawKey = KeyFactory.keyToString(entity.getKey());
@ -81,7 +81,7 @@ public class DeleteEntityActionTest {
}
@Test
public void test_deleteNonExistentEntityRepliesWithError() throws Exception {
public void test_deleteNonExistentEntityRepliesWithError() {
Entity entity = new Entity("not", "here");
String rawKey = KeyFactory.keyToString(entity.getKey());
action.rawKeys = rawKey;
@ -90,7 +90,7 @@ public class DeleteEntityActionTest {
}
@Test
public void test_deleteOneEntityAndNonExistentEntityRepliesWithError() throws Exception {
public void test_deleteOneEntityAndNonExistentEntityRepliesWithError() {
ReservedList ofyEntity = new ReservedList.Builder().setName("first_registered").build();
ofy().saveWithoutBackup().entity(ofyEntity).now();
String ofyKey = KeyFactory.keyToString(create(ofyEntity).getRaw());

View file

@ -34,14 +34,14 @@ public class ListHostsActionTest extends ListActionTestCase {
ListHostsAction action;
@Before
public void init() throws Exception {
public void init() {
createTld("foo");
action = new ListHostsAction();
action.clock = new FakeClock(DateTime.parse("2000-01-01TZ"));
}
@Test
public void testRun_noParameters() throws Exception {
public void testRun_noParameters() {
testRunSuccess(
action,
null,
@ -50,7 +50,7 @@ public class ListHostsActionTest extends ListActionTestCase {
}
@Test
public void testRun_twoLinesWithRepoId() throws Exception {
public void testRun_twoLinesWithRepoId() {
persistActiveHost("example2.foo");
persistActiveHost("example1.foo");
testRunSuccess(
@ -65,7 +65,7 @@ public class ListHostsActionTest extends ListActionTestCase {
}
@Test
public void testRun_twoLinesWithWildcard() throws Exception {
public void testRun_twoLinesWithWildcard() {
persistActiveHost("example2.foo");
persistActiveHost("example1.foo");
testRunSuccess(
@ -80,7 +80,7 @@ public class ListHostsActionTest extends ListActionTestCase {
}
@Test
public void testRun_twoLinesWithWildcardAndAnotherField() throws Exception {
public void testRun_twoLinesWithWildcardAndAnotherField() {
persistActiveHost("example2.foo");
persistActiveHost("example1.foo");
testRunSuccess(
@ -95,7 +95,7 @@ public class ListHostsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withBadField_returnsError() throws Exception {
public void testRun_withBadField_returnsError() {
persistActiveHost("example2.foo");
persistActiveHost("example1.foo");
testRunError(

View file

@ -31,14 +31,14 @@ public class ListPremiumListsActionTest extends ListActionTestCase {
ListPremiumListsAction action;
@Before
public void init() throws Exception {
public void init() {
persistPremiumList("xn--q9jyb4c", "rich,USD 100");
persistPremiumList("how", "richer,JPY 5000");
action = new ListPremiumListsAction();
}
@Test
public void testRun_noParameters() throws Exception {
public void testRun_noParameters() {
testRunSuccess(
action,
Optional.empty(),
@ -49,7 +49,7 @@ public class ListPremiumListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withParameters() throws Exception {
public void testRun_withParameters() {
testRunSuccess(
action,
Optional.of("revisionKey,description"),
@ -62,7 +62,7 @@ public class ListPremiumListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withWildcard() throws Exception {
public void testRun_withWildcard() {
testRunSuccess(
action,
Optional.of("*"),
@ -75,7 +75,7 @@ public class ListPremiumListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withBadField_returnsError() throws Exception {
public void testRun_withBadField_returnsError() {
testRunError(
action,
Optional.of("badfield"),

View file

@ -34,7 +34,7 @@ public class ListRegistrarsActionTest extends ListActionTestCase {
ListRegistrarsAction action;
@Before
public void init() throws Exception {
public void init() {
action = new ListRegistrarsAction();
createTlds("xn--q9jyb4c", "example");
// Ensure that NewRegistrar only has access to xn--q9jyb4c and that TheRegistrar only has access
@ -52,7 +52,7 @@ public class ListRegistrarsActionTest extends ListActionTestCase {
}
@Test
public void testRun_noParameters() throws Exception {
public void testRun_noParameters() {
testRunSuccess(
action,
Optional.empty(),
@ -63,7 +63,7 @@ public class ListRegistrarsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withParameters() throws Exception {
public void testRun_withParameters() {
testRunSuccess(
action,
Optional.of("allowedTlds"),
@ -76,7 +76,7 @@ public class ListRegistrarsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withWildcard() throws Exception {
public void testRun_withWildcard() {
testRunSuccess(
action,
Optional.of("*"),
@ -89,7 +89,7 @@ public class ListRegistrarsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withBadField_returnsError() throws Exception {
public void testRun_withBadField_returnsError() {
testRunError(
action,
Optional.of("badfield"),

View file

@ -35,7 +35,7 @@ public class ListReservedListsActionTest extends ListActionTestCase {
ListReservedListsAction action;
@Before
public void init() throws Exception {
public void init() {
ReservedList rl1 = persistReservedList("xn--q9jyb4c-published", true, "blah,FULLY_BLOCKED");
ReservedList rl2 = persistReservedList("xn--q9jyb4c-private", false, "dugong,FULLY_BLOCKED");
createTld("xn--q9jyb4c");
@ -44,7 +44,7 @@ public class ListReservedListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_noParameters() throws Exception {
public void testRun_noParameters() {
testRunSuccess(
action,
Optional.empty(),
@ -55,7 +55,7 @@ public class ListReservedListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withParameters() throws Exception {
public void testRun_withParameters() {
testRunSuccess(
action,
Optional.of("shouldPublish"),
@ -68,7 +68,7 @@ public class ListReservedListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withWildcard() throws Exception {
public void testRun_withWildcard() {
testRunSuccess(
action,
Optional.of("*"),
@ -81,7 +81,7 @@ public class ListReservedListsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withBadField_returnsError() throws Exception {
public void testRun_withBadField_returnsError() {
testRunError(
action,
Optional.of("badfield"),

View file

@ -24,28 +24,26 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
* Unit tests for {@link ListTldsAction}.
*/
/** Unit tests for {@link ListTldsAction}. */
@RunWith(JUnit4.class)
public class ListTldsActionTest extends ListActionTestCase {
ListTldsAction action;
@Before
public void init() throws Exception {
public void init() {
createTld("xn--q9jyb4c");
action = new ListTldsAction();
action.clock = new FakeClock(DateTime.parse("2000-01-01TZ"));
}
@Test
public void testRun_noParameters() throws Exception {
public void testRun_noParameters() {
testRunSuccess(action, Optional.empty(), Optional.empty(), Optional.empty(), "xn--q9jyb4c");
}
@Test
public void testRun_withParameters() throws Exception {
public void testRun_withParameters() {
testRunSuccess(
action,
Optional.of("tldType"),
@ -57,7 +55,7 @@ public class ListTldsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withWildcard() throws Exception {
public void testRun_withWildcard() {
testRunSuccess(
action,
Optional.of("*"),
@ -69,7 +67,7 @@ public class ListTldsActionTest extends ListActionTestCase {
}
@Test
public void testRun_withBadField_returnsError() throws Exception {
public void testRun_withBadField_returnsError() {
testRunError(
action,
Optional.of("badfield"),

View file

@ -35,7 +35,7 @@ import org.junit.runners.JUnit4;
public class PollMapreduceActionTest extends MapreduceTestCase<PollMapreduceAction> {
@Before
public void init() throws Exception {
public void init() {
action = new PollMapreduceAction();
}

View file

@ -47,7 +47,7 @@ public class UpdatePremiumListActionTest {
FakeJsonResponse response;
@Before
public void init() throws Exception {
public void init() {
createTlds("foo", "xn--q9jyb4c", "how");
action = new UpdatePremiumListAction();
response = new FakeJsonResponse();
@ -55,14 +55,14 @@ public class UpdatePremiumListActionTest {
}
@Test
public void test_invalidRequest_missingInput_returnsErrorStatus() throws Exception {
public void test_invalidRequest_missingInput_returnsErrorStatus() {
action.name = "foo";
action.run();
assertThat(response.getResponseMap().get("status")).isEqualTo("error");
}
@Test
public void test_invalidRequest_listDoesNotExist_returnsErrorStatus() throws Exception {
public void test_invalidRequest_listDoesNotExist_returnsErrorStatus() {
action.name = "bamboozle";
action.inputData = "richer,JPY 5000";
action.run();
@ -74,7 +74,7 @@ public class UpdatePremiumListActionTest {
}
@Test
public void test_success() throws Exception {
public void test_success() {
action.name = "foo";
action.inputData = "rich,USD 75\nricher,USD 5000\npoor, USD 0.99";
action.run();

View file

@ -146,7 +146,7 @@ public class VerifyOteActionTest {
}
@Test
public void testSuccess_summarize_allPass() throws Exception {
public void testSuccess_summarize_allPass() {
Map<String, Object> response =
action.handleJsonRequest(
ImmutableMap.of("summarize", "true", "registrars", ImmutableList.of("blobio")));
@ -156,7 +156,7 @@ public class VerifyOteActionTest {
}
@Test
public void testSuccess_summarize_someFailures() throws Exception {
public void testSuccess_summarize_someFailures() {
deleteResource(hostDeleteHistoryEntry);
deleteResource(domainCreateHistoryEntry);
deleteResource(domainRestoreHistoryEntry);
@ -169,7 +169,7 @@ public class VerifyOteActionTest {
}
@Test
public void testSuccess_passNotSummarized() throws Exception {
public void testSuccess_passNotSummarized() {
Map<String, Object> response =
action.handleJsonRequest(
ImmutableMap.of("summarize", "false", "registrars", ImmutableList.of("blobio")));
@ -205,7 +205,7 @@ public class VerifyOteActionTest {
}
@Test
public void testFailure_missingHostDelete() throws Exception {
public void testFailure_missingHostDelete() {
deleteResource(hostDeleteHistoryEntry);
Map<String, Object> response =