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

@ -84,7 +84,7 @@ public class LockTest {
}
@Test
public void testReleasedExplicitly() throws Exception {
public void testReleasedExplicitly() {
Optional<Lock> lock = acquire("", ONE_DAY, FREE);
assertThat(lock).isPresent();
// We can't get it again at the same time.
@ -96,7 +96,7 @@ public class LockTest {
}
@Test
public void testReleasedAfterTimeout() throws Exception {
public void testReleasedAfterTimeout() {
assertThat(acquire("", TWO_MILLIS, FREE)).isPresent();
// We can't get it again at the same time.
assertThat(acquire("", TWO_MILLIS, IN_USE)).isEmpty();
@ -109,7 +109,7 @@ public class LockTest {
}
@Test
public void testReleasedAfterRequestFinish() throws Exception {
public void testReleasedAfterRequestFinish() {
assertThat(acquire("", ONE_DAY, FREE)).isPresent();
// We can't get it again while request is active
assertThat(acquire("", ONE_DAY, IN_USE)).isEmpty();
@ -119,7 +119,7 @@ public class LockTest {
}
@Test
public void testTldsAreIndependent() throws Exception {
public void testTldsAreIndependent() {
Optional<Lock> lockA = acquire("a", ONE_DAY, FREE);
assertThat(lockA).isPresent();
// For a different tld we can still get a lock with the same name.
@ -134,7 +134,7 @@ public class LockTest {
}
@Test
public void testFailure_emptyResourceName() throws Exception {
public void testFailure_emptyResourceName() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,

View file

@ -40,14 +40,14 @@ public class ServerSecretTest {
}
@Test
public void testGet_bootstrapping_savesSecretToDatastore() throws Exception {
public void testGet_bootstrapping_savesSecretToDatastore() {
ServerSecret secret = ServerSecret.get();
assertThat(secret).isNotNull();
assertThat(ofy().load().entity(new ServerSecret()).now()).isEqualTo(secret);
}
@Test
public void testGet_existingSecret_returned() throws Exception {
public void testGet_existingSecret_returned() {
ServerSecret secret = ServerSecret.create(123, 456);
ofy().saveWithoutBackup().entity(secret).now();
assertThat(ServerSecret.get()).isEqualTo(secret);
@ -55,7 +55,7 @@ public class ServerSecretTest {
}
@Test
public void testGet_cachedSecret_returnedWithoutDatastoreRead() throws Exception {
public void testGet_cachedSecret_returnedWithoutDatastoreRead() {
int numInitialReads = RequestCapturingAsyncDatastoreService.getReads().size();
ServerSecret secret = ServerSecret.get();
int numReads = RequestCapturingAsyncDatastoreService.getReads().size();
@ -65,14 +65,14 @@ public class ServerSecretTest {
}
@Test
public void testAsUuid() throws Exception {
public void testAsUuid() {
UUID uuid = ServerSecret.create(123, 456).asUuid();
assertThat(uuid.getMostSignificantBits()).isEqualTo(123);
assertThat(uuid.getLeastSignificantBits()).isEqualTo(456);
}
@Test
public void testAsBytes() throws Exception {
public void testAsBytes() {
byte[] bytes = ServerSecret.create(123, 0x456).asBytes();
assertThat(bytes)
.isEqualTo(new byte[] {0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0x4, 0x56});