@Test
public void testLog_AnonymousLoggingHasNoUsernameForActionTypeStatistic() {

    IUserActivityLogger userActivityLogger = createUserActivityLogger(userSessionMock, true);
    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 have empty username '' because it is anonymus and ActionType=statistic", "", returnValue.getValue().getUserName());
}