use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldFireBeforeUserRemovedEventOnRemoveExistedUser.
@Test
public void shouldFireBeforeUserRemovedEventOnRemoveExistedUser() throws Exception {
final UserImpl user = users[0];
final BeforeUserRemovedEvent[] firedEvent = { null };
EventSubscriber<BeforeUserRemovedEvent> beforeUserRemovedSubscriber = event -> firedEvent[0] = event;
eventService.subscribe(beforeUserRemovedSubscriber, BeforeUserRemovedEvent.class);
userDao.remove(user.getId());
assertNotNull(firedEvent[0]);
assertEquals(firedEvent[0].getUser().getId(), user.getId());
eventService.unsubscribe(beforeUserRemovedSubscriber, BeforeUserRemovedEvent.class);
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldFireUserRemovedEventOnRemoveExistedUser.
@Test
public void shouldFireUserRemovedEventOnRemoveExistedUser() throws Exception {
final UserImpl user = users[0];
final UserRemovedEvent[] firedEvent = { null };
EventSubscriber<UserRemovedEvent> userRemovedSubscriber = event -> firedEvent[0] = event;
eventService.subscribe(userRemovedSubscriber, UserRemovedEvent.class);
userDao.remove(user.getId());
assertNotNull(firedEvent[0]);
assertEquals(firedEvent[0].getUserId(), user.getId());
eventService.unsubscribe(userRemovedSubscriber, UserRemovedEvent.class);
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldGetUserByAlias.
@Test
public void shouldGetUserByAlias() throws Exception {
final UserImpl user = users[0];
assertEqualsNoPassword(userDao.getByAlias(user.getAliases().get(0)), user);
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldThrowNotFoundExceptionIfUserWithSuchNameOrEmailDoesNotExist.
@Test(expectedExceptions = NotFoundException.class)
public void shouldThrowNotFoundExceptionIfUserWithSuchNameOrEmailDoesNotExist() throws Exception {
final UserImpl user = users[0];
userDao.getByAliasAndPassword(user.getId(), user.getPassword());
}
use of org.eclipse.che.api.user.server.model.impl.UserImpl in project che by eclipse.
the class UserDaoTest method shouldThrowConflictExceptionWhenCreatingUserWithExistingId.
@Test(expectedExceptions = ConflictException.class)
public void shouldThrowConflictExceptionWhenCreatingUserWithExistingId() throws Exception {
final UserImpl newUser = new UserImpl(users[0].getId(), "user123@eclipse.org", "user_name", "password", asList("google:user123", "github:user123"));
userDao.create(newUser);
}
Aggregations