diff --git a/spring-session-core/src/test/java/org/springframework/session/MapSessionTests.java b/spring-session-core/src/test/java/org/springframework/session/MapSessionTests.java index 8ece096e..ce6d2cd3 100644 --- a/spring-session-core/src/test/java/org/springframework/session/MapSessionTests.java +++ b/spring-session-core/src/test/java/org/springframework/session/MapSessionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ class MapSessionTests { } @Test - void constructorWhenSessionIdGenerationStrategyThenUsesStrategy() { + void constructorWhenSessionIdGeneratorThenUsesStrategy() { MapSession session = new MapSession(new FixedSessionIdGenerator("my-id")); assertThat(session.getId()).isEqualTo("my-id"); } diff --git a/spring-session-core/src/test/java/org/springframework/session/ReactiveMapSessionRepositoryTests.java b/spring-session-core/src/test/java/org/springframework/session/ReactiveMapSessionRepositoryTests.java index 96a4d3ae..7e4933c3 100644 --- a/spring-session-core/src/test/java/org/springframework/session/ReactiveMapSessionRepositoryTests.java +++ b/spring-session-core/src/test/java/org/springframework/session/ReactiveMapSessionRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -153,7 +153,7 @@ class ReactiveMapSessionRepositoryTests { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.repository.setSessionIdGenerator(() -> "test"); MapSession session = this.repository.createSession().block(); assertThat(session.getId()).isEqualTo("test"); @@ -161,13 +161,13 @@ class ReactiveMapSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.repository.setSessionIdGenerator(() -> "test"); MapSession session = this.repository.createSession().block(); diff --git a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/MongoIndexedSessionRepositoryTest.java b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/MongoIndexedSessionRepositoryTest.java index 05b4bdc4..a9e86ad5 100644 --- a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/MongoIndexedSessionRepositoryTest.java +++ b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/MongoIndexedSessionRepositoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -212,7 +212,7 @@ public class MongoIndexedSessionRepositoryTest { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.repository.setSessionIdGenerator(new FixedSessionIdGenerator("123")); MongoSession session = this.repository.createSession(); assertThat(session.getId()).isEqualTo("123"); @@ -220,12 +220,12 @@ public class MongoIndexedSessionRepositoryTest { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.repository.setSessionIdGenerator(new FixedSessionIdGenerator("456")); Document sessionDocument = new Document(); diff --git a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/ReactiveMongoSessionRepositoryTest.java b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/ReactiveMongoSessionRepositoryTest.java index d070fbbf..9e15d382 100644 --- a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/ReactiveMongoSessionRepositoryTest.java +++ b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/ReactiveMongoSessionRepositoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -212,7 +212,7 @@ public class ReactiveMongoSessionRepositoryTest { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.repository.setSessionIdGenerator(() -> "test"); this.repository.createSession().as(StepVerifier::create).assertNext((mongoSession) -> { @@ -222,13 +222,13 @@ public class ReactiveMongoSessionRepositoryTest { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.repository.setSessionIdGenerator(() -> "test"); String sessionId = UUID.randomUUID().toString(); diff --git a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfigurationTest.java b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfigurationTest.java index 1cd48e12..d21c0216 100644 --- a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfigurationTest.java +++ b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -203,14 +203,14 @@ public class MongoHttpSessionConfigurationTest { } @Test - void registerWhenSessionIdGenerationStrategyBeanThenUses() { - registerAndRefresh(SessionIdGenerationStrategyConfiguration.class); + void registerWhenSessionIdGeneratorBeanThenUses() { + registerAndRefresh(SessionIdGeneratorConfiguration.class); MongoIndexedSessionRepository sessionRepository = this.context.getBean(MongoIndexedSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class); } @Test - void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() { + void registerWhenNoSessionIdGeneratorBeanThenDefault() { registerAndRefresh(DefaultConfiguration.class); MongoIndexedSessionRepository sessionRepository = this.context.getBean(MongoIndexedSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class); @@ -369,10 +369,10 @@ public class MongoHttpSessionConfigurationTest { @Configuration(proxyBeanMethods = false) @EnableMongoHttpSession @Import(MongoConfiguration.class) - static class SessionIdGenerationStrategyConfiguration { + static class SessionIdGeneratorConfiguration { @Bean - SessionIdGenerator sessionIdGenerationStrategy() { + SessionIdGenerator sessionIdGenerator() { return new TestSessionIdGenerator(); } diff --git a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/reactive/ReactiveMongoWebSessionConfigurationTest.java b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/reactive/ReactiveMongoWebSessionConfigurationTest.java index 6067db9a..8b46c123 100644 --- a/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/reactive/ReactiveMongoWebSessionConfigurationTest.java +++ b/spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/reactive/ReactiveMongoWebSessionConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -225,14 +225,14 @@ public class ReactiveMongoWebSessionConfigurationTest { } @Test - void registerWhenSessionIdGenerationStrategyBeanThenUses() { - registerAndRefresh(GoodConfig.class, SessionIdGenerationStrategyConfiguration.class); + void registerWhenSessionIdGeneratorBeanThenUses() { + registerAndRefresh(GoodConfig.class, SessionIdGeneratorConfiguration.class); ReactiveMongoSessionRepository sessionRepository = this.context.getBean(ReactiveMongoSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class); } @Test - void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() { + void registerWhenNoSessionIdGeneratorBeanThenDefault() { registerAndRefresh(GoodConfig.class); ReactiveMongoSessionRepository sessionRepository = this.context.getBean(ReactiveMongoSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class); @@ -434,10 +434,10 @@ public class ReactiveMongoWebSessionConfigurationTest { } @Configuration(proxyBeanMethods = false) - static class SessionIdGenerationStrategyConfiguration { + static class SessionIdGeneratorConfiguration { @Bean - SessionIdGenerator sessionIdGenerationStrategy() { + SessionIdGenerator sessionIdGenerator() { return new TestSessionIdGenerator(); } diff --git a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/ReactiveRedisSessionRepositoryTests.java b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/ReactiveRedisSessionRepositoryTests.java index 0afea0d3..baa6d14d 100644 --- a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/ReactiveRedisSessionRepositoryTests.java +++ b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/ReactiveRedisSessionRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -439,7 +439,7 @@ class ReactiveRedisSessionRepositoryTests { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.repository.setSessionIdGenerator(() -> "test"); this.repository.createSession().as(StepVerifier::create).assertNext((redisSession) -> { @@ -449,14 +449,14 @@ class ReactiveRedisSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test @SuppressWarnings("unchecked") - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.repository.setSessionIdGenerator(() -> "changed-session-id"); given(this.redisOperations.opsForHash()).willReturn(this.hashOperations); String attribute1 = "attribute1"; diff --git a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryTests.java b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryTests.java index 0b8493e6..f580a543 100644 --- a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryTests.java +++ b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -911,7 +911,7 @@ class RedisIndexedSessionRepositoryTests { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.redisRepository.setSessionIdGenerator(() -> "test"); RedisSession session = this.redisRepository.createSession(); assertThat(session.getId()).isEqualTo("test"); @@ -919,13 +919,13 @@ class RedisIndexedSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.redisRepository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.redisRepository.setSessionIdGenerator(() -> "test"); String attribute1 = "attribute1"; String attribute2 = "attribute2"; diff --git a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisSessionRepositoryTests.java b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisSessionRepositoryTests.java index 58e3c607..6f930b72 100644 --- a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisSessionRepositoryTests.java +++ b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisSessionRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -374,7 +374,7 @@ class RedisSessionRepositoryTests { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.sessionRepository.setSessionIdGenerator(() -> "test"); RedisSessionRepository.RedisSession session = this.sessionRepository.createSession(); assertThat(session.getId()).isEqualTo("test"); @@ -382,13 +382,13 @@ class RedisSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.sessionRepository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.sessionRepository.setSessionIdGenerator(() -> "test"); Instant now = Instant.now().truncatedTo(ChronoUnit.MILLIS); given(this.sessionHashOperations.entries(eq(TEST_SESSION_KEY))) diff --git a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisHttpsSessionConfigurationTests.java b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisHttpsSessionConfigurationTests.java index 2de2c428..b1d27358 100644 --- a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisHttpsSessionConfigurationTests.java +++ b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisHttpsSessionConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -209,14 +209,14 @@ class RedisHttpsSessionConfigurationTests { } @Test - void registerWhenSessionIdGenerationStrategyBeanThenUses() { - registerAndRefresh(RedisConfig.class, SessionIdGenerationStrategyConfiguration.class); + void registerWhenSessionIdGeneratorBeanThenUses() { + registerAndRefresh(RedisConfig.class, SessionIdGeneratorConfiguration.class); RedisSessionRepository sessionRepository = this.context.getBean(RedisSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class); } @Test - void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() { + void registerWhenNoSessionIdGeneratorBeanThenDefault() { registerAndRefresh(RedisConfig.class, DefaultConfiguration.class); RedisSessionRepository sessionRepository = this.context.getBean(RedisSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class); @@ -399,10 +399,10 @@ class RedisHttpsSessionConfigurationTests { @Configuration(proxyBeanMethods = false) @EnableRedisHttpSession - static class SessionIdGenerationStrategyConfiguration { + static class SessionIdGeneratorConfiguration { @Bean - SessionIdGenerator sessionIdGenerationStrategy() { + SessionIdGenerator sessionIdGenerator() { return new TestSessionIdGenerator(); } diff --git a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisIndexedHttpSessionConfigurationTests.java b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisIndexedHttpSessionConfigurationTests.java index 2183e3ad..161f406b 100644 --- a/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisIndexedHttpSessionConfigurationTests.java +++ b/spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisIndexedHttpSessionConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -243,14 +243,14 @@ class RedisIndexedHttpSessionConfigurationTests { } @Test - void registerWhenSessionIdGenerationStrategyBeanThenUses() { - registerAndRefresh(RedisConfig.class, SessionIdGenerationStrategyConfiguration.class); + void registerWhenSessionIdGeneratorBeanThenUses() { + registerAndRefresh(RedisConfig.class, SessionIdGeneratorConfiguration.class); RedisIndexedSessionRepository sessionRepository = this.context.getBean(RedisIndexedSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class); } @Test - void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() { + void registerWhenNoSessionIdGeneratorBeanThenDefault() { registerAndRefresh(RedisConfig.class, DefaultConfiguration.class); RedisIndexedSessionRepository sessionRepository = this.context.getBean(RedisIndexedSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class); @@ -462,10 +462,10 @@ class RedisIndexedHttpSessionConfigurationTests { @Configuration(proxyBeanMethods = false) @EnableRedisIndexedHttpSession - static class SessionIdGenerationStrategyConfiguration { + static class SessionIdGeneratorConfiguration { @Bean - SessionIdGenerator sessionIdGenerationStrategy() { + SessionIdGenerator sessionIdGenerator() { return new TestSessionIdGenerator(); } diff --git a/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/HazelcastIndexedSessionRepositoryTests.java b/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/HazelcastIndexedSessionRepositoryTests.java index 35ede804..5865ce8c 100644 --- a/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/HazelcastIndexedSessionRepositoryTests.java +++ b/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/HazelcastIndexedSessionRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -466,7 +466,7 @@ class HazelcastIndexedSessionRepositoryTests { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.repository.setSessionIdGenerator(() -> "test"); HazelcastSession session = this.repository.createSession(); assertThat(session.getId()).isEqualTo("test"); @@ -474,13 +474,13 @@ class HazelcastIndexedSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.repository.setSessionIdGenerator(() -> "test"); MapSession saved = new MapSession("original"); saved.setAttribute("savedName", "savedValue"); diff --git a/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationTests.java b/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationTests.java index b241daaa..413340e2 100644 --- a/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationTests.java +++ b/spring-session-hazelcast/src/test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -241,15 +241,15 @@ class HazelcastHttpSessionConfigurationTests { } @Test - void registerWhenSessionIdGenerationStrategyBeanThenUses() { - registerAndRefresh(DefaultConfiguration.class, SessionIdGenerationStrategyConfiguration.class); + void registerWhenSessionIdGeneratorBeanThenUses() { + registerAndRefresh(DefaultConfiguration.class, SessionIdGeneratorConfiguration.class); HazelcastIndexedSessionRepository sessionRepository = this.context .getBean(HazelcastIndexedSessionRepository.class); assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class); } @Test - void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() { + void registerWhenNoSessionIdGeneratorBeanThenDefault() { registerAndRefresh(DefaultConfiguration.class); HazelcastIndexedSessionRepository sessionRepository = this.context .getBean(HazelcastIndexedSessionRepository.class); @@ -484,10 +484,10 @@ class HazelcastHttpSessionConfigurationTests { } @Configuration(proxyBeanMethods = false) - static class SessionIdGenerationStrategyConfiguration { + static class SessionIdGeneratorConfiguration { @Bean - SessionIdGenerator sessionIdGenerationStrategy() { + SessionIdGenerator sessionIdGenerator() { return new TestSessionIdGenerator(); } diff --git a/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/JdbcIndexedSessionRepositoryTests.java b/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/JdbcIndexedSessionRepositoryTests.java index 4e8533bc..159e5982 100644 --- a/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/JdbcIndexedSessionRepositoryTests.java +++ b/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/JdbcIndexedSessionRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -264,7 +264,7 @@ class JdbcIndexedSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenException() { + void setSessionIdGeneratorWhenNullThenException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @@ -776,7 +776,7 @@ class JdbcIndexedSessionRepositoryTests { } @Test - void createSessionWhenSessionIdGenerationStrategyThenUses() { + void createSessionWhenSessionIdGeneratorThenUses() { this.repository.setSessionIdGenerator(() -> "test"); JdbcSession session = this.repository.createSession(); assertThat(session.getId()).isEqualTo("test"); @@ -784,13 +784,13 @@ class JdbcIndexedSessionRepositoryTests { } @Test - void setSessionIdGenerationStrategyWhenNullThenThrowsException() { + void setSessionIdGeneratorWhenNullThenThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null)) .withMessage("sessionIdGenerator cannot be null"); } @Test - void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() { + void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() { this.repository.setSessionIdGenerator(() -> "test"); Session saved = this.repository.new JdbcSession(new MapSession(), "primaryKey", false); saved.setAttribute("savedName", "savedValue"); diff --git a/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/config/annotation/web/http/JdbcHttpSessionConfigurationTests.java b/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/config/annotation/web/http/JdbcHttpSessionConfigurationTests.java index bfdc376c..8d1ccead 100644 --- a/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/config/annotation/web/http/JdbcHttpSessionConfigurationTests.java +++ b/spring-session-jdbc/src/test/java/org/springframework/session/jdbc/config/annotation/web/http/JdbcHttpSessionConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -322,8 +322,8 @@ class JdbcHttpSessionConfigurationTests { } @Test - void sessionIdGenerationStrategyWhenCustomBeanThenUses() { - registerAndRefresh(DataSourceConfiguration.class, CustomSessionIdGenerationStrategyConfiguration.class); + void sessionIdGeneratorWhenCustomBeanThenUses() { + registerAndRefresh(DataSourceConfiguration.class, CustomSessionIdGeneratorConfiguration.class); JdbcIndexedSessionRepository sessionRepository = this.context.getBean(JdbcIndexedSessionRepository.class); SessionIdGenerator sessionIdGenerator = (SessionIdGenerator) ReflectionTestUtils.getField(sessionRepository, "sessionIdGenerator"); @@ -331,7 +331,7 @@ class JdbcHttpSessionConfigurationTests { } @Test - void sessionIdGenerationStrategyWhenNoBeanThenDefault() { + void sessionIdGeneratorWhenNoBeanThenDefault() { registerAndRefresh(DataSourceConfiguration.class, DefaultConfiguration.class); JdbcIndexedSessionRepository sessionRepository = this.context.getBean(JdbcIndexedSessionRepository.class); SessionIdGenerator sessionIdGenerator = (SessionIdGenerator) ReflectionTestUtils.getField(sessionRepository, @@ -346,10 +346,10 @@ class JdbcHttpSessionConfigurationTests { @Configuration(proxyBeanMethods = false) @EnableJdbcHttpSession - static class CustomSessionIdGenerationStrategyConfiguration { + static class CustomSessionIdGeneratorConfiguration { @Bean - SessionIdGenerator sessionIdGenerationStrategy() { + SessionIdGenerator sessionIdGenerator() { return new FixedSessionIdGenerator("my-id"); }