RedisSessionStore implements SessionStore { String sessionKey(String sessionId, String domain) { return "session:" + Hash.sha256Hex(domain + ":" + sessionId); } RedisSessionStore(Redis redis); @Override Map<String, String> getAndRefresh(String sessionId, String domain, Duration sessionTimeout); @Override void save(String sessionId, String domain, Map<String, String> values, Set<String> changedFields, Duration sessionTimeout); @Override void invalidate(String sessionId, String domain); @Override void invalidateByKey(String key, String value);  }
@Test void sessionKey() { assertThat(store.sessionKey("someSessionId", "domain")) .doesNotContain("someSessionId") .doesNotContain("domain") .startsWith("session:"); }