### Question:
AcmLoginSuccessOperations { protected void addUserIdToSession(HttpServletRequest request, String userId) { HttpSession session = request.getSession(true); session.setAttribute("acm_username", userId); log.debug("Session 'acm_username' set to '{}'", userId); MDC.put(MDCConstants.EVENT_MDC_REQUEST_USER_ID_KEY, userId); }  void onSuccessfulAuthentication(HttpServletRequest request, Authentication authentication); AcmPluginManager getAcmPluginManager(); void setAcmPluginManager(AcmPluginManager acmPluginManager); AcmApplication getAcmApplication(); void setAcmApplication(AcmApplication acmApplication); UserDao getUserDao(); void setUserDao(UserDao userDao); AuditPropertyEntityAdapter getAuditPropertyEntityAdapter(); void setAuditPropertyEntityAdapter(AuditPropertyEntityAdapter auditPropertyEntityAdapter); ObjectConverter getObjectConverter(); void setObjectConverter(ObjectConverter objectConverter);  }### Answer:
@Test public void addUserIdToSession() { String userId = "userId"; expect(mockRequest.getSession(true)).andReturn(mockSession); mockSession.setAttribute("acm_username", userId); replayAll(); unit.addUserIdToSession(mockRequest, userId); verifyAll(); }