@Test
public void testLog_NoAnonymousLoggingForActionTypeAdmin() {

    IUserActivityLogger userActivityLogger = createUserActivityLogger(userSessionMock, true);
    ILoggingAction loginAction = createLoggingActionMock(ActionType.admin);
    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 username '" + testUserName + "' because it is anonymus but ActionType=admin", testUserName, returnValue.getValue().getUserName());
}