Skip to content

Commit f7662b0

Browse files
quaffmarcusdacoregio
authored andcommitted
Continue renaming SessionIdGenerationStrategy to SessionIdGenerator
1 parent b4e9af9 commit f7662b0

File tree

15 files changed

+71
-71
lines changed

15 files changed

+71
-71
lines changed

spring-session-core/src/test/java/org/springframework/session/MapSessionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2019 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ void constructorNullSession() {
4444
}
4545

4646
@Test
47-
void constructorWhenSessionIdGenerationStrategyThenUsesStrategy() {
47+
void constructorWhenSessionIdGeneratorThenUsesStrategy() {
4848
MapSession session = new MapSession(new FixedSessionIdGenerator("my-id"));
4949
assertThat(session.getId()).isEqualTo("my-id");
5050
}

spring-session-core/src/test/java/org/springframework/session/ReactiveMapSessionRepositoryTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -153,21 +153,21 @@ void getAttributeNamesAndRemove() {
153153
}
154154

155155
@Test
156-
void createSessionWhenSessionIdGenerationStrategyThenUses() {
156+
void createSessionWhenSessionIdGeneratorThenUses() {
157157
this.repository.setSessionIdGenerator(() -> "test");
158158
MapSession session = this.repository.createSession().block();
159159
assertThat(session.getId()).isEqualTo("test");
160160
assertThat(session.changeSessionId()).isEqualTo("test");
161161
}
162162

163163
@Test
164-
void setSessionIdGenerationStrategyWhenNullThenThrowsException() {
164+
void setSessionIdGeneratorWhenNullThenThrowsException() {
165165
assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null))
166166
.withMessage("sessionIdGenerator cannot be null");
167167
}
168168

169169
@Test
170-
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() {
170+
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
171171
this.repository.setSessionIdGenerator(() -> "test");
172172

173173
MapSession session = this.repository.createSession().block();

spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/MongoIndexedSessionRepositoryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -212,20 +212,20 @@ void shouldReturnEmptyMapForNotSupportedIndex() {
212212
}
213213

214214
@Test
215-
void createSessionWhenSessionIdGenerationStrategyThenUses() {
215+
void createSessionWhenSessionIdGeneratorThenUses() {
216216
this.repository.setSessionIdGenerator(new FixedSessionIdGenerator("123"));
217217
MongoSession session = this.repository.createSession();
218218
assertThat(session.getId()).isEqualTo("123");
219219
assertThat(session.changeSessionId()).isEqualTo("123");
220220
}
221221

222222
@Test
223-
void setSessionIdGenerationStrategyWhenNullThenThrowsException() {
223+
void setSessionIdGeneratorWhenNullThenThrowsException() {
224224
assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null));
225225
}
226226

227227
@Test
228-
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() {
228+
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
229229
this.repository.setSessionIdGenerator(new FixedSessionIdGenerator("456"));
230230

231231
Document sessionDocument = new Document();

spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/ReactiveMongoSessionRepositoryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -212,7 +212,7 @@ void shouldInvokeMethodToCreateIndexesImperatively() {
212212
}
213213

214214
@Test
215-
void createSessionWhenSessionIdGenerationStrategyThenUses() {
215+
void createSessionWhenSessionIdGeneratorThenUses() {
216216
this.repository.setSessionIdGenerator(() -> "test");
217217

218218
this.repository.createSession().as(StepVerifier::create).assertNext((mongoSession) -> {
@@ -222,13 +222,13 @@ void createSessionWhenSessionIdGenerationStrategyThenUses() {
222222
}
223223

224224
@Test
225-
void setSessionIdGenerationStrategyWhenNullThenThrowsException() {
225+
void setSessionIdGeneratorWhenNullThenThrowsException() {
226226
assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null))
227227
.withMessage("sessionIdGenerator cannot be null");
228228
}
229229

230230
@Test
231-
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() {
231+
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
232232
this.repository.setSessionIdGenerator(() -> "test");
233233

234234
String sessionId = UUID.randomUUID().toString();

spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/http/MongoHttpSessionConfigurationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -203,14 +203,14 @@ void importConfigAndCustomize() {
203203
}
204204

205205
@Test
206-
void registerWhenSessionIdGenerationStrategyBeanThenUses() {
207-
registerAndRefresh(SessionIdGenerationStrategyConfiguration.class);
206+
void registerWhenSessionIdGeneratorBeanThenUses() {
207+
registerAndRefresh(SessionIdGeneratorConfiguration.class);
208208
MongoIndexedSessionRepository sessionRepository = this.context.getBean(MongoIndexedSessionRepository.class);
209209
assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class);
210210
}
211211

212212
@Test
213-
void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() {
213+
void registerWhenNoSessionIdGeneratorBeanThenDefault() {
214214
registerAndRefresh(DefaultConfiguration.class);
215215
MongoIndexedSessionRepository sessionRepository = this.context.getBean(MongoIndexedSessionRepository.class);
216216
assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class);
@@ -369,10 +369,10 @@ SessionRepositoryCustomizer<MongoIndexedSessionRepository> sessionRepositoryCust
369369
@Configuration(proxyBeanMethods = false)
370370
@EnableMongoHttpSession
371371
@Import(MongoConfiguration.class)
372-
static class SessionIdGenerationStrategyConfiguration {
372+
static class SessionIdGeneratorConfiguration {
373373

374374
@Bean
375-
SessionIdGenerator sessionIdGenerationStrategy() {
375+
SessionIdGenerator sessionIdGenerator() {
376376
return new TestSessionIdGenerator();
377377
}
378378

spring-session-data-mongodb/src/test/java/org/springframework/session/data/mongo/config/annotation/web/reactive/ReactiveMongoWebSessionConfigurationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -225,14 +225,14 @@ void importConfigAndCustomize() {
225225
}
226226

227227
@Test
228-
void registerWhenSessionIdGenerationStrategyBeanThenUses() {
229-
registerAndRefresh(GoodConfig.class, SessionIdGenerationStrategyConfiguration.class);
228+
void registerWhenSessionIdGeneratorBeanThenUses() {
229+
registerAndRefresh(GoodConfig.class, SessionIdGeneratorConfiguration.class);
230230
ReactiveMongoSessionRepository sessionRepository = this.context.getBean(ReactiveMongoSessionRepository.class);
231231
assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class);
232232
}
233233

234234
@Test
235-
void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() {
235+
void registerWhenNoSessionIdGeneratorBeanThenDefault() {
236236
registerAndRefresh(GoodConfig.class);
237237
ReactiveMongoSessionRepository sessionRepository = this.context.getBean(ReactiveMongoSessionRepository.class);
238238
assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class);
@@ -434,10 +434,10 @@ ReactiveSessionRepositoryCustomizer<ReactiveMongoSessionRepository> sessionRepos
434434
}
435435

436436
@Configuration(proxyBeanMethods = false)
437-
static class SessionIdGenerationStrategyConfiguration {
437+
static class SessionIdGeneratorConfiguration {
438438

439439
@Bean
440-
SessionIdGenerator sessionIdGenerationStrategy() {
440+
SessionIdGenerator sessionIdGenerator() {
441441
return new TestSessionIdGenerator();
442442
}
443443

spring-session-data-redis/src/test/java/org/springframework/session/data/redis/ReactiveRedisSessionRepositoryTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -439,7 +439,7 @@ void saveWithSaveModeAlways() {
439439
}
440440

441441
@Test
442-
void createSessionWhenSessionIdGenerationStrategyThenUses() {
442+
void createSessionWhenSessionIdGeneratorThenUses() {
443443
this.repository.setSessionIdGenerator(() -> "test");
444444

445445
this.repository.createSession().as(StepVerifier::create).assertNext((redisSession) -> {
@@ -449,14 +449,14 @@ void createSessionWhenSessionIdGenerationStrategyThenUses() {
449449
}
450450

451451
@Test
452-
void setSessionIdGenerationStrategyWhenNullThenThrowsException() {
452+
void setSessionIdGeneratorWhenNullThenThrowsException() {
453453
assertThatIllegalArgumentException().isThrownBy(() -> this.repository.setSessionIdGenerator(null))
454454
.withMessage("sessionIdGenerator cannot be null");
455455
}
456456

457457
@Test
458458
@SuppressWarnings("unchecked")
459-
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() {
459+
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
460460
this.repository.setSessionIdGenerator(() -> "changed-session-id");
461461
given(this.redisOperations.opsForHash()).willReturn(this.hashOperations);
462462
String attribute1 = "attribute1";

spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -911,21 +911,21 @@ void saveWithSaveModeAlways() {
911911
}
912912

913913
@Test
914-
void createSessionWhenSessionIdGenerationStrategyThenUses() {
914+
void createSessionWhenSessionIdGeneratorThenUses() {
915915
this.redisRepository.setSessionIdGenerator(() -> "test");
916916
RedisSession session = this.redisRepository.createSession();
917917
assertThat(session.getId()).isEqualTo("test");
918918
assertThat(session.changeSessionId()).isEqualTo("test");
919919
}
920920

921921
@Test
922-
void setSessionIdGenerationStrategyWhenNullThenThrowsException() {
922+
void setSessionIdGeneratorWhenNullThenThrowsException() {
923923
assertThatIllegalArgumentException().isThrownBy(() -> this.redisRepository.setSessionIdGenerator(null))
924924
.withMessage("sessionIdGenerator cannot be null");
925925
}
926926

927927
@Test
928-
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() {
928+
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
929929
this.redisRepository.setSessionIdGenerator(() -> "test");
930930
String attribute1 = "attribute1";
931931
String attribute2 = "attribute2";

spring-session-data-redis/src/test/java/org/springframework/session/data/redis/RedisSessionRepositoryTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -374,21 +374,21 @@ void getSessionRedisOperations__ShouldReturnRedisOperations() {
374374
}
375375

376376
@Test
377-
void createSessionWhenSessionIdGenerationStrategyThenUses() {
377+
void createSessionWhenSessionIdGeneratorThenUses() {
378378
this.sessionRepository.setSessionIdGenerator(() -> "test");
379379
RedisSessionRepository.RedisSession session = this.sessionRepository.createSession();
380380
assertThat(session.getId()).isEqualTo("test");
381381
assertThat(session.changeSessionId()).isEqualTo("test");
382382
}
383383

384384
@Test
385-
void setSessionIdGenerationStrategyWhenNullThenThrowsException() {
385+
void setSessionIdGeneratorWhenNullThenThrowsException() {
386386
assertThatIllegalArgumentException().isThrownBy(() -> this.sessionRepository.setSessionIdGenerator(null))
387387
.withMessage("sessionIdGenerator cannot be null");
388388
}
389389

390390
@Test
391-
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerationStrategy() {
391+
void findByIdWhenChangeSessionIdThenUsesSessionIdGenerator() {
392392
this.sessionRepository.setSessionIdGenerator(() -> "test");
393393
Instant now = Instant.now().truncatedTo(ChronoUnit.MILLIS);
394394
given(this.sessionHashOperations.entries(eq(TEST_SESSION_KEY)))

spring-session-data-redis/src/test/java/org/springframework/session/data/redis/config/annotation/web/http/RedisHttpsSessionConfigurationTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -209,14 +209,14 @@ void importConfigAndCustomize() {
209209
}
210210

211211
@Test
212-
void registerWhenSessionIdGenerationStrategyBeanThenUses() {
213-
registerAndRefresh(RedisConfig.class, SessionIdGenerationStrategyConfiguration.class);
212+
void registerWhenSessionIdGeneratorBeanThenUses() {
213+
registerAndRefresh(RedisConfig.class, SessionIdGeneratorConfiguration.class);
214214
RedisSessionRepository sessionRepository = this.context.getBean(RedisSessionRepository.class);
215215
assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(TestSessionIdGenerator.class);
216216
}
217217

218218
@Test
219-
void registerWhenNoSessionIdGenerationStrategyBeanThenDefault() {
219+
void registerWhenNoSessionIdGeneratorBeanThenDefault() {
220220
registerAndRefresh(RedisConfig.class, DefaultConfiguration.class);
221221
RedisSessionRepository sessionRepository = this.context.getBean(RedisSessionRepository.class);
222222
assertThat(sessionRepository).extracting("sessionIdGenerator").isInstanceOf(UuidSessionIdGenerator.class);
@@ -399,10 +399,10 @@ SessionRepositoryCustomizer<RedisSessionRepository> sessionRepositoryCustomizer(
399399

400400
@Configuration(proxyBeanMethods = false)
401401
@EnableRedisHttpSession
402-
static class SessionIdGenerationStrategyConfiguration {
402+
static class SessionIdGeneratorConfiguration {
403403

404404
@Bean
405-
SessionIdGenerator sessionIdGenerationStrategy() {
405+
SessionIdGenerator sessionIdGenerator() {
406406
return new TestSessionIdGenerator();
407407
}
408408

0 commit comments

Comments
 (0)