@Test
public void sendLostPasswordToken() {
User user = generateTestUser();
when(userRepository.findByEmailAddress(user.getEmailAddress())).thenReturn(user);
VerificationToken token = verificationTokenService.sendLostPasswordToken(new LostPasswordRequest(user.getEmailAddress()));
assertThat(user.getVerificationTokens().size(), is(1));
assertThat(user.getActiveLostPasswordToken(), is(token));
assertThat(token, is(not(Matchers.<Object>nullValue())));
assertThat(tokens.size(), is(1));
String sentToken = tokens.get(0);
assertThat(sentToken, is(not(nullValue())));
assertThat(sentToken, is(token.getToken()));
assertThat(token.getTokenType(), is(VerificationToken.VerificationTokenType.lostPassword));
}