session, sessionMutex);
}
@Test
public void testGetSessionMutexWithExistingSessionMutexReturnsTheExistingSessionMutex() throws Exception {
MockPortletSession session = new MockPortletSession();
Object expectSessionMutex = new Object();
session.setAttribute(WebUtils.SESSION_MUTEX_ATTRIBUTE, expectSessionMutex, PortletSession.APPLICATION_SCOPE);
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);
}