}
@Test(expectedExceptions = MailingFailedException.class)
public void testRestorePasswordFail() throws NotFoundException, MailingFailedException {
JCUser user = new JCUser(USERNAME, EMAIL, PASSWORD);
Exception fail = new MailingFailedException(new RuntimeException());
doThrow(fail).when(mailService).sendPasswordRecoveryMail(eq(user), anyString());
when(userDao.getByEmail(EMAIL)).thenReturn(user);
try {
userService.restorePassword(EMAIL);