use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.
the class TestAddGroup method testAddingGroup.
@Test
public void testAddingGroup() {
Group o = new Group();
o.setName("default");
o = groupDao.update(o, null);
assertNotNull("Id of group created should not be null", o.getId());
User us = userDao.get(1L);
assertNotNull("User should exist", us);
assertNotNull("Group User list should exist", us.getGroupUsers());
us.getGroupUsers().add(new GroupUser(o, us));
us = userDao.update(us, null);
log.error(us.getLastname());
log.error(us.getAddress().getTown());
}
use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.
the class TestEmailTemplate method testTemplateGeneration.
@Test
public void testTemplateGeneration() {
User u = new User();
u.setLanguageId(rnd.nextInt(30));
UserContact uc = new UserContact();
uc.setOwner(u);
uc.setContact(new User());
checkTemplate(FeedbackTemplate.getEmail("testuser", "email", "message"));
checkTemplate(InvitationTemplate.getEmail(u, "testuser", "email", "message"));
checkTemplate(RegisterUserTemplate.getEmail("testuser", "email", "message"));
checkTemplate(RequestContactConfirmTemplate.getEmail(uc));
checkTemplate(RequestContactTemplate.getEmail(u, new User()));
checkTemplate(ResetPasswordTemplate.getEmail("link"));
}
use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.
the class TestUserContact method createUserWithGroup.
@Test
public void createUserWithGroup() throws Exception {
String uuid = UUID.randomUUID().toString();
User u = getUser(uuid);
u.getGroupUsers().add(new GroupUser(groupDao.get(1L), u));
u = userDao.update(u, null);
assertTrue("Password should be set as expected", userDao.verifyPassword(u.getId(), createPass()));
User u1 = userDao.get(u.getId());
assertNotNull("Just created user should not be null", u1);
assertNotNull("Just created user should have non null org-users", u1.getGroupUsers());
assertFalse("Just created user should have not empty org-users", u1.getGroupUsers().isEmpty());
}
use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.
the class TestUserContact method addContactByOwner.
@Test
public void addContactByOwner() throws Exception {
login(null, null);
List<User> users = userDao.getAllUsers();
assertNotNull("User list should not be null ", users);
assertFalse("User list should not be empty ", users.isEmpty());
User contact = createUserContact(getUserId());
String email = contact.getAddress().getEmail();
List<User> l = userDao.get(email, false, 0, 9999);
// check that contact is visible for admin
assertNotNull("Contact list should not be null for admin ", l);
assertFalse("Contact list should not be empty for admin ", l.isEmpty());
// check that contact is visible for owner
l = userDao.get(email, 0, 9999, null, true, getUserId());
assertTrue("Contact list should not be empty for owner ", !l.isEmpty());
// delete contact
userDao.delete(contact, getUserId());
l = userDao.get(email, false, 0, 9999);
assertTrue("Contact list should be empty after deletion", l.isEmpty());
User u = createUser();
User u1 = createUser();
contact = createUserContact(u.getId());
email = contact.getAddress().getEmail();
// check that contact is not visible for user that is not owner of this contact
l = userDao.get(email, 0, 9999, null, true, u1.getId());
assertTrue("Contact list should be empty for another user", l.isEmpty());
// delete contact
userDao.delete(contact, u.getId());
l = userDao.get(email, false, 0, 9999);
assertTrue("Contact list should be empty after deletion", l.isEmpty());
}
use of org.apache.openmeetings.db.entity.user.User in project openmeetings by apache.
the class TestUserContact method testCreateUser.
@Test
public void testCreateUser() throws Exception {
String uuid = UUID.randomUUID().toString();
User u = createUser(uuid);
assertTrue("Password should be set as expected", userDao.verifyPassword(u.getId(), createPass()));
}
Aggregations