@SuppressWarnings("unchecked")
@Test
public void testStoreSessionData() {

  RedisFacade facade = mock(RedisFacade.class);
  SessionManager sm = mock(SessionManager.class);
  JdkSerializerDeserializer serializer = new JdkSerializerDeserializer();
  when(sm.getSerializerDeserializer()).thenReturn(serializer);
  SessionConfiguration conf = new SessionConfiguration();
  when(sm.getConfiguration()).thenReturn(conf);
  try (RedisSessionRepository rsr = new RedisSessionRepository(facade, "myapp", "localhost", ExpirationStrategy.ZRANGE, false)) {
    rsr.setSessionManager(sm);
    SessionData sessionData = mock(SessionData.class);
    when(sessionData.getId()).thenReturn("id");
    rsr.storeSessionData(sessionData);
    @SuppressWarnings("rawtypes")
    ArgumentCaptor<Map> map = ArgumentCaptor.forClass(Map.class);
    verify(facade).hmset(eq(rsr.sessionKey("id")), map.capture());
  }
}