public void inviteRegisteredNotifyNoActivated() throws ActionException {
registeredUserChecks(false);
}
private void registeredUserChecks(boolean receiveEmails) throws ActionException{
User registered = persistUser(receiveEmails);
SendInvitationActionHandler handler = injector.getInstance(SendInvitationActionHandler.class);
SendInvitationResult result = handler.execute(new SendInvitation(registered.getEmail()), mock(ExecutionContext.class));
assertEquals(true, result.isSent());
User fromDb = appEntity.find(User.class, registered.getEmail());
assertNotNull(fromDb);
assertEquals(registered.getUserId(), fromDb.getUserId());
assertEquals(registered.getAuthDomain(), fromDb.getAuthDomain());
assertEquals(receiveEmails, fromDb.isReceiveEmails());
assertEquals(1, fromDb.getPendingFriends().size());
assertTrue("Pending friends = "+fromDb.getPendingFriends(), fromDb.getPendingFriends().contains(email));
assertEquals(registered.getLogins().size()+1, fromDb.getLogins().size());
}