Remove unnecessary throws declaration

This commit is contained in:
Vedran Pavic
2019-07-02 19:21:07 +02:00
parent 0731e7f2d0
commit 1ca9daccb4
26 changed files with 91 additions and 114 deletions

View File

@@ -159,13 +159,13 @@ class RedisOperationsSessionRepositoryTests {
}
@Test
void createSessionDefaultMaxInactiveInterval() throws Exception {
void createSessionDefaultMaxInactiveInterval() {
Session session = this.redisRepository.createSession();
assertThat(session.getMaxInactiveInterval()).isEqualTo(new MapSession().getMaxInactiveInterval());
}
@Test
void createSessionCustomMaxInactiveInterval() throws Exception {
void createSessionCustomMaxInactiveInterval() {
int interval = 1;
this.redisRepository.setDefaultMaxInactiveInterval(interval);
Session session = this.redisRepository.createSession();

View File

@@ -80,7 +80,7 @@ class RedisSessionExpirationPolicyTests {
// gh-169
@Test
void onExpirationUpdatedRemovesOriginalExpirationTimeRoundedUp() throws Exception {
void onExpirationUpdatedRemovesOriginalExpirationTimeRoundedUp() {
long originalExpirationTimeInMs = ONE_MINUTE_AGO;
long originalRoundedToNextMinInMs = RedisSessionExpirationPolicy
.roundUpToNextMinute(originalExpirationTimeInMs);
@@ -94,7 +94,7 @@ class RedisSessionExpirationPolicyTests {
}
@Test
void onExpirationUpdatedDoNotSendDeleteWhenExpirationTimeDoesNotChange() throws Exception {
void onExpirationUpdatedDoNotSendDeleteWhenExpirationTimeDoesNotChange() {
long originalExpirationTimeInMs = RedisSessionExpirationPolicy.expiresInMillis(this.session) - 10;
long originalRoundedToNextMinInMs = RedisSessionExpirationPolicy
.roundUpToNextMinute(originalExpirationTimeInMs);
@@ -108,7 +108,7 @@ class RedisSessionExpirationPolicyTests {
}
@Test
void onExpirationUpdatedAddsExpirationTimeRoundedUp() throws Exception {
void onExpirationUpdatedAddsExpirationTimeRoundedUp() {
long expirationTimeInMs = RedisSessionExpirationPolicy.expiresInMillis(this.session);
long expirationRoundedUpInMs = RedisSessionExpirationPolicy.roundUpToNextMinute(expirationTimeInMs);
String expectedExpireKey = this.policy.getExpirationKey(expirationRoundedUpInMs);
@@ -122,7 +122,7 @@ class RedisSessionExpirationPolicyTests {
}
@Test
void onExpirationUpdatedSetExpireSession() throws Exception {
void onExpirationUpdatedSetExpireSession() {
String sessionKey = this.policy.getSessionKey(this.session.getId());
this.policy.onExpirationUpdated(null, this.session);
@@ -133,7 +133,7 @@ class RedisSessionExpirationPolicyTests {
}
@Test
void onExpirationUpdatedDeleteOnZero() throws Exception {
void onExpirationUpdatedDeleteOnZero() {
String sessionKey = this.policy.getSessionKey("expires:" + this.session.getId());
long originalExpirationTimeInMs = ONE_MINUTE_AGO;
@@ -151,7 +151,7 @@ class RedisSessionExpirationPolicyTests {
}
@Test
void onExpirationUpdatedPersistOnNegativeExpiration() throws Exception {
void onExpirationUpdatedPersistOnNegativeExpiration() {
long originalExpirationTimeInMs = ONE_MINUTE_AGO;
this.session.setMaxInactiveInterval(Duration.ofSeconds(-1));

View File

@@ -61,7 +61,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetUnset() throws Exception {
void afterPropertiesSetUnset() {
setConfigNotification("");
this.initializer.afterPropertiesSet();
@@ -70,7 +70,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetA() throws Exception {
void afterPropertiesSetA() {
setConfigNotification("A");
this.initializer.afterPropertiesSet();
@@ -79,7 +79,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetE() throws Exception {
void afterPropertiesSetE() {
setConfigNotification("E");
this.initializer.afterPropertiesSet();
@@ -88,7 +88,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetK() throws Exception {
void afterPropertiesSetK() {
setConfigNotification("K");
this.initializer.afterPropertiesSet();
@@ -97,7 +97,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetAE() throws Exception {
void afterPropertiesSetAE() {
setConfigNotification("AE");
this.initializer.afterPropertiesSet();
@@ -106,7 +106,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetAK() throws Exception {
void afterPropertiesSetAK() {
setConfigNotification("AK");
this.initializer.afterPropertiesSet();
@@ -115,7 +115,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetEK() throws Exception {
void afterPropertiesSetEK() {
setConfigNotification("EK");
this.initializer.afterPropertiesSet();
@@ -124,7 +124,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetEg() throws Exception {
void afterPropertiesSetEg() {
setConfigNotification("Eg");
this.initializer.afterPropertiesSet();
@@ -133,7 +133,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetE$() throws Exception {
void afterPropertiesSetE$() {
setConfigNotification("E$");
this.initializer.afterPropertiesSet();
@@ -142,7 +142,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetKg() throws Exception {
void afterPropertiesSetKg() {
setConfigNotification("Kg");
this.initializer.afterPropertiesSet();
@@ -151,7 +151,7 @@ class EnableRedisKeyspaceNotificationsInitializerTests {
}
@Test
void afterPropertiesSetAEK() throws Exception {
void afterPropertiesSetAEK() {
setConfigNotification("AEK");
this.initializer.afterPropertiesSet();

View File

@@ -47,8 +47,7 @@ class RedisHttpSessionConfigurationMockTests {
}
@Test
void enableRedisKeyspaceNotificationsInitializerAfterPropertiesSetWhenNoOpThenNoInteractionWithConnectionFactory()
throws Exception {
void enableRedisKeyspaceNotificationsInitializerAfterPropertiesSetWhenNoOpThenNoInteractionWithConnectionFactory() {
EnableRedisKeyspaceNotificationsInitializer init = new EnableRedisKeyspaceNotificationsInitializer(this.factory,
ConfigureRedisAction.NO_OP);
@@ -58,8 +57,7 @@ class RedisHttpSessionConfigurationMockTests {
}
@Test
void enableRedisKeyspaceNotificationsInitializerAfterPropertiesSetWhenExceptionThenCloseConnection()
throws Exception {
void enableRedisKeyspaceNotificationsInitializerAfterPropertiesSetWhenExceptionThenCloseConnection() {
ConfigureRedisAction action = mock(ConfigureRedisAction.class);
willThrow(new RuntimeException()).given(action).configure(this.connection);
@@ -77,8 +75,7 @@ class RedisHttpSessionConfigurationMockTests {
}
@Test
void enableRedisKeyspaceNotificationsInitializerAfterPropertiesSetWhenNoExceptionThenCloseConnection()
throws Exception {
void enableRedisKeyspaceNotificationsInitializerAfterPropertiesSetWhenNoExceptionThenCloseConnection() {
ConfigureRedisAction action = mock(ConfigureRedisAction.class);
EnableRedisKeyspaceNotificationsInitializer init = new EnableRedisKeyspaceNotificationsInitializer(this.factory,