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());