assertSame("PortletUtils.getSessionMutex(..) must return the exact same PortletSession supplied as an argument if no mutex has been bound as a Session attribute beforehand",
session, sessionMutex);
}
public void testGetSessionMutexWithExistingSessionMutexReturnsTheExistingSessionMutex() throws Exception {
MockPortletSession session = new MockPortletSession();
Object expectSessionMutex = new Object();
session.setAttribute(WebUtils.SESSION_MUTEX_ATTRIBUTE, expectSessionMutex);
Object actualSessionMutex = PortletUtils.getSessionMutex(session);
assertNotNull("PortletUtils.getSessionMutex(..) must never return a null mutex", actualSessionMutex);
assertSame("PortletUtils.getSessionMutex(..) must return the bound mutex attribute if a mutex has been bound as a Session attribute beforehand",
expectSessionMutex, actualSessionMutex);
}