@Test
public void testLog_update() {

    IUserActivityLogger userActivityLogger = createUserActivityLogger(userSessionMock, true);
    ILoggingAction loginAction = createLoggingActionMock(ActionType.admin);
    when(loginAction.getActionObject()).thenReturn("test");
    // first call to create log objext
    ReturnValue<LoggingObject> returnValue = userActivityLogger.log(loginAction, this.getClass(), null);
    verify(activityLoggingDaoMock).saveLogObject(returnValue.getValue());
    // session_.getEntry(USESS_KEY_USER_ACTIVITY_LOGGING_LAST_LOG)
    when(userSessionMock.getEntry(UserActivityLoggerImpl.USESS_KEY_USER_ACTIVITY_LOGGING_LAST_LOG)).thenReturn(returnValue.getValue());
    // second call for duration
    ReturnValue<LoggingObject> lastReturnValue = userActivityLogger.log(loginAction, this.getClass(), null);
    verify(activityLoggingDaoMock).updateDuration(eq(returnValue.getValue()), anyLong());
    verify(activityLoggingDaoMock).saveLogObject(lastReturnValue.getValue());
}