Polish WebSession support code

This commit is contained in:
Rossen Stoyanchev
2017-07-14 22:10:31 +02:00
parent c802827f0f
commit bf712957f6
6 changed files with 90 additions and 69 deletions

View File

@@ -27,6 +27,7 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.lang.Nullable;
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
import org.springframework.web.server.ServerWebExchange;
@@ -139,6 +140,7 @@ public class DefaultWebSessionManagerTests {
private List<String> idsToResolve = new ArrayList<>();
@Nullable
private String id = null;
@@ -146,6 +148,7 @@ public class DefaultWebSessionManagerTests {
this.idsToResolve = idsToResolve;
}
@Nullable
public String getSavedId() {
return this.id;
}
@@ -159,6 +162,11 @@ public class DefaultWebSessionManagerTests {
public void setSessionId(ServerWebExchange exchange, String sessionId) {
this.id = sessionId;
}
@Override
public void expireSession(ServerWebExchange exchange) {
this.id = null;
}
}
}