use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldThrowConflictExceptionWhenCreatingUserWithExistingAliases.
@Test(expectedExceptions = ConflictException.class)
public void shouldThrowConflictExceptionWhenCreatingUserWithExistingAliases() throws Exception {
final UserImpl newUser = new UserImpl("user123", "user123@eclipse.org", "user_name", "password", users[0].getAliases());
userDao.create(newUser);
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldGetUserByName.
@Test
public void shouldGetUserByName() throws Exception {
final UserImpl user = users[0];
assertEqualsNoPassword(userDao.getByName(user.getName()), user);
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldCreateUser.
@Test(dependsOnMethods = "shouldGetUserById")
public void shouldCreateUser() throws Exception {
final UserImpl newUser = new UserImpl("user123", "user123@eclipse.org", "user_name", "password", asList("google:user123", "github:user123"));
userDao.create(newUser);
assertEqualsNoPassword(userDao.getById(newUser.getId()), newUser);
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method setUp.
@BeforeMethod
public void setUp() throws TckRepositoryException {
users = new UserImpl[COUNT_OF_USERS];
for (int i = 0; i < users.length; i++) {
final String id = NameGenerator.generate("user", Constants.ID_LENGTH);
final String name = "user_name-" + i;
final String email = name + "@eclipse.org";
final String password = NameGenerator.generate("", Constants.PASSWORD_LENGTH);
final List<String> aliases = new ArrayList<>(asList("google:" + name, "github:" + name));
users[i] = new UserImpl(id, email, name, password, aliases);
}
tckRepository.createAll(Arrays.asList(users));
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldGetUserByNameAndPassword.
@Test
public void shouldGetUserByNameAndPassword() throws Exception {
final UserImpl user = users[0];
assertEqualsNoPassword(userDao.getByAliasAndPassword(user.getName(), user.getPassword()), user);
}
Aggregations