@Test
public void testLog_NoneAnonymousLoggingHasUsernameForActionTypeStatistic() {

    IUserActivityLogger userActivityLogger = createUserActivityLogger(userSessionMock, false);
    ILoggingAction loginAction = createLoggingActionMock(ActionType.statistic);
    when(loginAction.getActionObject()).thenReturn("test");
    ReturnValue<LoggingObject> returnValue = userActivityLogger.log(loginAction, this.getClass(), null);
    verify(activityLoggingDaoMock).saveLogObject(returnValue.getValue());
    assertNotNull("Missing logging, no log-object created ", returnValue.getValue());
    assertEquals("Logging must use username '" + testUserName + "' because it is non-anonymus and ActionType=statistic", testUserName, returnValue.getValue()
            .getUserName());
}