@Test
public void testUserExistsException() {

    // set expectations
    final User user = new User("admin");
    user.setEmail("matt@raibledesigns.com");
    willThrow(new DataIntegrityViolationException("")).given(userDao).saveUser(user);
    // run test
    try {
        userManager.saveUser(user);
        fail("Expected UserExistsException not thrown");
    } catch (UserExistsException e) {
        log.debug("expected exception: " + e.getMessage());
        assertNotNull(e);
    }
}