Compare commits
5 Commits
main
...
1.1.1.RELE
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b53e52f529 | ||
|
|
debaea0b58 | ||
|
|
f8707009bd | ||
|
|
47d897c846 | ||
|
|
09d7704c9e |
@@ -6,9 +6,6 @@ This guide describes how to use Spring Session to find sessions by username.
|
||||
|
||||
NOTE: The completed guide can be found in the <<findbyusername-sample, findbyusername application>>.
|
||||
|
||||
NOTE: This feature will likely be refactored in the next release to account for https://github.com/spring-projects/spring-session/issues/301[#301]
|
||||
|
||||
|
||||
[[findbyusername-assumptions]]
|
||||
== Assumptions
|
||||
|
||||
|
||||
@@ -24,7 +24,9 @@ Additional features include:
|
||||
|
||||
== What's New in 1.1
|
||||
|
||||
Below are the highlights of what is new in Spring Session 1.1. You can find a complete list of what's new in https://github.com/spring-projects/spring-session/issues?utf8=%E2%9C%93&q=milestone%3A%221.1.0+M1%22[1.1.0 M1] and https://github.com/spring-projects/spring-session/issues?utf8=%E2%9C%93&q=milestone%3A%221.1.0+RC1%22[1.1.0 RC1] by referring to the changelog.
|
||||
Below are the highlights of what is new in Spring Session 1.1. You can find a complete list of what's new in https://github.com/spring-projects/spring-session/issues?utf8=%E2%9C%93&q=milestone%3A%221.1.0+M1%22[1.1.0 M1], https://github.com/spring-projects/spring-session/issues?utf8=%E2%9C%93&q=milestone%3A%221.1.0+RC1%22[1.1.0 RC1], and
|
||||
https://github.com/spring-projects/spring-session/issues?utf8=%E2%9C%93&q=milestone%3A%221.1.0%22[1.1.0]
|
||||
by referring to the changelog.
|
||||
|
||||
* https://github.com/spring-projects/spring-session/issues/148[#148] - Added <<httpsession-gemfire,GemFire Support>>
|
||||
* https://github.com/spring-projects/spring-session/issues/7[#7] - link:guides/findbyusername.html[Query by Username]
|
||||
@@ -37,6 +39,7 @@ Below are the highlights of what is new in Spring Session 1.1. You can find a co
|
||||
* https://github.com/spring-projects/spring-session/issues/273[#273] - Allow writing to Redis immediately (instead of lazily) using <<api-redisoperationssessionrepository-config,redisFlushMode>>
|
||||
* https://github.com/spring-projects/spring-session/issues/272[#272] - Add `ExpiringSession.setLastAccessedTime(long)`
|
||||
* https://github.com/spring-projects/spring-session/pull/349[#349] - Added https://gitter.im/spring-projects/spring-session[Gitter Room] for discussing Spring Session
|
||||
* https://github.com/spring-projects/spring-session/issues/388[#388] - Support Spring Framework WebSockets
|
||||
|
||||
[[samples]]
|
||||
== Samples and Guides (Start Here)
|
||||
|
||||
@@ -3,7 +3,7 @@ jacksonVersion=2.6.5
|
||||
jspApiVersion=2.0
|
||||
servletApiVersion=3.0.1
|
||||
jstlelVersion=1.2.5
|
||||
version=1.1.1.BUILD-SNAPSHOT
|
||||
version=1.1.1.RELEASE
|
||||
springDataRedisVersion=1.6.2.RELEASE
|
||||
junitVersion=4.12
|
||||
gebVersion=0.13.1
|
||||
|
||||
@@ -59,6 +59,9 @@ public class DefaultCookieSerializer implements CookieSerializer {
|
||||
for (Cookie cookie : cookies) {
|
||||
if (cookieName.equals(cookie.getName())) {
|
||||
String sessionId = cookie.getValue();
|
||||
if(sessionId == null) {
|
||||
continue;
|
||||
}
|
||||
if(jvmRoute != null && sessionId.endsWith(jvmRoute)) {
|
||||
sessionId = sessionId.substring(0, sessionId.length() - jvmRoute.length());
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ public class AbstractGemFireOperationsSessionRepositoryTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void afterCreatedWithNonSessionTypeDoesNotPublishSessionCreatedEvent() {
|
||||
TestGemFireOperationsSessionRepository sessionRepository = new TestGemFireOperationsSessionRepository(mockGemfireOperations) {
|
||||
@Override protected void handleCreated(final String sessionId, final ExpiringSession session) {
|
||||
@@ -307,12 +307,12 @@ public class AbstractGemFireOperationsSessionRepositoryTest {
|
||||
}
|
||||
};
|
||||
|
||||
EntryEvent<Object, ?> mockEntryEvent = mock(EntryEvent.class);
|
||||
EntryEvent mockEntryEvent = mock(EntryEvent.class);
|
||||
|
||||
when(mockEntryEvent.getKey()).thenReturn("abc123");
|
||||
when(mockEntryEvent.getNewValue()).thenReturn(new Object());
|
||||
|
||||
sessionRepository.afterCreate((EntryEvent<Object, ExpiringSession>) mockEntryEvent);
|
||||
sessionRepository.afterCreate(mockEntryEvent);
|
||||
|
||||
verify(mockEntryEvent, never()).getKey();
|
||||
verify(mockEntryEvent, times(1)).getNewValue();
|
||||
@@ -427,7 +427,7 @@ public class AbstractGemFireOperationsSessionRepositoryTest {
|
||||
EntryEvent<Object, ?> mockEntryEvent = mock(EntryEvent.class);
|
||||
|
||||
when(mockEntryEvent.getKey()).thenReturn(sessionId);
|
||||
when(mockEntryEvent.getOldValue()).thenReturn(new Object());
|
||||
when(mockEntryEvent.getOldValue()).thenReturn(null);
|
||||
|
||||
sessionRepository.setApplicationEventPublisher(mockApplicationEventPublisher);
|
||||
sessionRepository.afterDestroy((EntryEvent<Object, ExpiringSession>) mockEntryEvent);
|
||||
@@ -548,7 +548,7 @@ public class AbstractGemFireOperationsSessionRepositoryTest {
|
||||
EntryEvent<Object, ?> mockEntryEvent = mock(EntryEvent.class);
|
||||
|
||||
when(mockEntryEvent.getKey()).thenReturn(sessionId);
|
||||
when(mockEntryEvent.getOldValue()).thenReturn(new Object());
|
||||
when(mockEntryEvent.getOldValue()).thenReturn(null);
|
||||
|
||||
sessionRepository.setApplicationEventPublisher(mockApplicationEventPublisher);
|
||||
sessionRepository.afterInvalidate((EntryEvent<Object, ExpiringSession>) mockEntryEvent);
|
||||
|
||||
@@ -88,6 +88,30 @@ public class DefaultCookieSerializerTests {
|
||||
assertThat(serializer.readCookieValues(request)).containsExactly(sessionId, secondSession);
|
||||
}
|
||||
|
||||
// gh-392
|
||||
@Test
|
||||
public void readCookieValuesNullCookieValue() {
|
||||
request.setCookies(new Cookie(cookieName, null));
|
||||
|
||||
assertThat(serializer.readCookieValues(request)).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readCookieValuesNullCookieValueAndJvmRoute() {
|
||||
serializer.setJvmRoute("123");
|
||||
request.setCookies(new Cookie(cookieName, null));
|
||||
|
||||
assertThat(serializer.readCookieValues(request)).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readCookieValuesNullCookieValueAndNotNullCookie() {
|
||||
serializer.setJvmRoute("123");
|
||||
request.setCookies(new Cookie(cookieName, null), new Cookie(cookieName, sessionId));
|
||||
|
||||
assertThat(serializer.readCookieValues(request)).containsOnly(sessionId);
|
||||
}
|
||||
|
||||
// --- writeCookie ---
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user