@Test
public void testSession() throws Exception {
final RedisConnection conn = mock(RedisConnection.class);
final StringRedisConnection stringConn = mock(StringRedisConnection.class);
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
final StringRedisTemplate template = spy(new StringRedisTemplate(factory));
when(factory.getConnection()).thenReturn(conn);
doReturn(stringConn).when(template).preProcessConnection(eq(conn), anyBoolean());
template.execute(new SessionCallback<Object>() {
@SuppressWarnings("rawtypes")
public Object execute(RedisOperations operations) {