UserBeanOAM oam = injector.getInstance(UserBeanOAM.class);
com.google.appengine.api.users.User user = new com.google.appengine.api.users.User(email, UserBeanOAM.AUTH_DOMAIN_NOT_REGISTERED, "anyUserId");
oam.persistUser(new Date(0), user, ravenWasInvitedBy, ravenWasInvitedBy);
RedirectImpl register = injector.getInstance(RedirectImpl.class);
HttpServletRequest req = mock(HttpServletRequest.class);
when(req.getParameterMap()).thenReturn(new HashMap<String,String[]>());
when(req.getRequestURL()).thenReturn(new StringBuffer("changestuffs/anyuri"));
when(req.getRequestURI()).thenReturn("anyuri");
register.manage(req, mock(HttpServletResponse.class));
User fromDb = appEntity.find(User.class, user.getEmail());
assertEquals(authDomain, fromDb.getAuthDomain());
assertEquals(true, fromDb.isReceiveEmails());
assertNotSame(user.getUserId(), fromDb.getUserId());
assertEquals(1, fromDb.getPendingFriends().size());