Rename MapReactiveSessionRepository to ReactiveMapSessionRepository

Closes gh-928
This commit is contained in:
Vedran Pavic
2017-11-13 23:26:44 +01:00
parent 36d349f328
commit fc4d2238bc
4 changed files with 12 additions and 12 deletions

View File

@@ -38,7 +38,7 @@ import org.springframework.session.events.SessionExpiredEvent;
* @author Rob Winch
* @since 2.0
*/
public class MapReactiveSessionRepository implements ReactiveSessionRepository<MapSession> {
public class ReactiveMapSessionRepository implements ReactiveSessionRepository<MapSession> {
/**
* If non-null, this value is used to override
@@ -54,7 +54,7 @@ public class MapReactiveSessionRepository implements ReactiveSessionRepository<M
*
* @param sessions the {@link Map} to use. Cannot be null.
*/
public MapReactiveSessionRepository(Map<String, Session> sessions) {
public ReactiveMapSessionRepository(Map<String, Session> sessions) {
if (sessions == null) {
throw new IllegalArgumentException("sessions cannot be null");
}

View File

@@ -35,7 +35,7 @@ import org.springframework.context.annotation.Import;
*
* {@literal @Bean}
* public ReactiveSessionRepository sessionRepository() {
* return new MapReactiveSessionRepository();
* return new ReactiveMapSessionRepository();
* }
*
* }

View File

@@ -29,20 +29,20 @@ import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link MapReactiveSessionRepository}.
* Tests for {@link ReactiveMapSessionRepository}.
*
* @author Rob Winch
* @since 2.0
*/
public class MapReactiveSessionRepositoryTests {
public class ReactiveMapSessionRepositoryTests {
private MapReactiveSessionRepository repository;
private ReactiveMapSessionRepository repository;
private MapSession session;
@Before
public void setup() {
this.repository = new MapReactiveSessionRepository(new HashMap<>());
this.repository = new ReactiveMapSessionRepository(new HashMap<>());
this.session = new MapSession("session-id");
}
@@ -50,7 +50,7 @@ public class MapReactiveSessionRepositoryTests {
public void constructorMapThenFound() {
Map<String, Session> sessions = new HashMap<>();
sessions.put(this.session.getId(), this.session);
this.repository = new MapReactiveSessionRepository(sessions);
this.repository = new ReactiveMapSessionRepository(sessions);
Session findByIdSession = this.repository.findById(this.session.getId()).block();
assertThat(findByIdSession).isNotNull();
@@ -60,7 +60,7 @@ public class MapReactiveSessionRepositoryTests {
@Test(expected = IllegalArgumentException.class)
public void constructorMapWhenNullThenThrowsIllegalArgumentException() {
Map<String, Session> sessions = null;
new MapReactiveSessionRepository(sessions);
new ReactiveMapSessionRepository(sessions);
}
@Test
@@ -86,7 +86,7 @@ public class MapReactiveSessionRepositoryTests {
Map<String, Session> sessions = new ConcurrentHashMap<>();
sessions.put("session-id", this.session);
this.repository = new MapReactiveSessionRepository(sessions);
this.repository = new ReactiveMapSessionRepository(sessions);
assertThat(this.repository.findById(this.session.getId()).block()).isNull();
assertThat(sessions).isEmpty();

View File

@@ -112,7 +112,7 @@ public class SpringWebSessionConfigurationTests {
*/
@Bean
ReactiveSessionRepository<?> reactiveSessionRepository() {
return new MapReactiveSessionRepository(new HashMap<>());
return new ReactiveMapSessionRepository(new HashMap<>());
}
}
@@ -129,7 +129,7 @@ public class SpringWebSessionConfigurationTests {
@Bean
ReactiveSessionRepository<?> reactiveSessionRepository() {
return new MapReactiveSessionRepository(new HashMap<>());
return new ReactiveMapSessionRepository(new HashMap<>());
}
@Bean