Polishing

1. fix deprecations
2. fix generics
3. use lambda instead of anonymous class
4. mark some fields as final
This commit is contained in:
Yanming Zhou
2023-08-23 10:39:53 +08:00
committed by Marcus Hert Da Coregio
parent 831d65a97c
commit 11ce4b4561
18 changed files with 96 additions and 98 deletions

View File

@@ -790,6 +790,7 @@ class JdbcIndexedSessionRepositoryTests {
}
@Test
@SuppressWarnings("unchecked")
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
this.repository.setSessionIdGenerator(() -> "test");
Session saved = this.repository.new JdbcSession(new MapSession(), "primaryKey", false);

View File

@@ -72,13 +72,11 @@ class JdbcHttpSessionConfigurationTests {
private static final String CLEANUP_CRON_EXPRESSION = "0 0 * * * *";
private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@AfterEach
void closeContext() {
if (this.context != null) {
this.context.close();
}
this.context.close();
}
@Test
@@ -407,7 +405,7 @@ class JdbcHttpSessionConfigurationTests {
static class CustomMaxInactiveIntervalInSecondsSetterConfiguration extends JdbcHttpSessionConfiguration {
CustomMaxInactiveIntervalInSecondsSetterConfiguration() {
setMaxInactiveIntervalInSeconds(MAX_INACTIVE_INTERVAL_IN_SECONDS);
setMaxInactiveInterval(Duration.ofSeconds(MAX_INACTIVE_INTERVAL_IN_SECONDS));
}
}