Continue renaming SessionIdGenerationStrategy to SessionIdGenerator
This commit is contained in:
committed by
Marcus Hert Da Coregio
parent
b4e9af9ca4
commit
f7662b03b3
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user