### Question:
RedisStore extends AbstractLifecycle implements RedisStoreManagement, Store { @Override public void save(final Session session) { this.lockTemplate.withReadLock( new LockTemplate.LockedOperation<Void>() { @Override public Void invoke() { try { byte[] serialized = RedisStore.this.sessionSerializationUtils.serialize(session); RedisStore.this.jedisClient.set(getRedisSessionId(session), getSessionKeyPrefix(), serialized, session.getMaxInactiveInterval()); } catch (JedisConnectionException e) { RedisStore.this.logger.error("Unable to persist session {}", getRedisSessionId(session), e); } catch (IOException e) { RedisStore.this.logger.error("Unable to save session {}", getRedisSessionId(session), e); } return null; } } ); } RedisStore();   RedisStore(JmxSupport jmxSupport, PropertyChangeSupport propertyChangeSupport,
               SessionSerializationUtils sessionSerializationUtils, JedisClient jedisClient); @Override void addPropertyChangeListener(PropertyChangeListener propertyChangeListener); @Override void clear(); @Override int getConnectionPoolSize(); void setConnectionPoolSize(final int connectionPoolSize); @Override int getDatabase(); void setDatabase(final int database); @Override String getSessionKeyPrefix(); void setSessionKeyPrefix(final String sessionKeyPrefix); @Override String getHost(); void setHost(final String host); @Override Manager getManager(); @Override void setManager(final Manager manager); @Override String getPassword(); void setPassword(final String password); @Override int getPort(); void setPort(final int port); @Override int getSize(); @Override int getTimeout(); void setTimeout(final int timeout); @Override String getUri(); @Override boolean getCluster(); void setCluster(final boolean cluster); void setUri(final String uri); @Override String[] keys(); @Override Session load(final String id); @Override void remove(final String id); @Override void removePropertyChangeListener(PropertyChangeListener propertyChangeListener); @Override void save(final Session session); static final int DEFAULT_SO_TIMEOUT; }### Answer:
@Test public void save() throws IOException { Session session = new StandardSession(this.manager); session.setId("test-id"); this.store.save(session); verify(this.jedisClient).set(getRedisSessionId(session), SESSIONS_KEY, this.sessionSerializationUtils.serialize(session), session.getMaxInactiveInterval()); }
@Test public void saveJedisConnectionException() throws UnsupportedEncodingException { Session session = new StandardSession(this.manager); session.setId("test-id"); doThrow(new JedisConnectionException("test-message")) .when(this.jedisClient) .set(anyString(), anyString(), any((byte[].class)), eq(session.getMaxInactiveInterval())); this.store.save(session); }