SessionApplicationStatePersistenceStrategy implements ApplicationStatePersistenceStrategy { public <T> void set(Class<T> ssoClass, T sso) { String key = buildKey(ssoClass); getSession().setAttribute(key, sso); } SessionApplicationStatePersistenceStrategy(Request request); @SuppressWarnings("unchecked") T get(Class<T> ssoClass, ApplicationStateCreator<T> creator); T getIfExists(Class<T> ssoClass); void set(Class<T> ssoClass, T sso); boolean exists(Class<T> ssoClass);  }
@SuppressWarnings("unchecked") @Test public void set_aso() { Request request = mockRequest(); Session session = mockSession(); Class asoClass = ReadOnlyBean.class; Object aso = new ReadOnlyBean(); String key = "sso:" + asoClass.getName(); train_getSession(request, true, session); session.setAttribute(key, aso); replay(); ApplicationStatePersistenceStrategy strategy = new SessionApplicationStatePersistenceStrategy(request); strategy.set(asoClass, aso); verify(); }