@Test
public void testCreatePasswordResetToken_PasswordResetToken_With_Correct_ExpireInHours_Is_Saved_By_PasswordResetTokenRepository()
		throws UsernameNotExistException, EmailAddressNotExistException,
		MessagingException {

	// Arrange
	final String resetPasswordLinkPlaceHolder = "http://comsent2share.com/resetPassword.html?token=%s";
	final String emailAddress = "emailAddress";
	Patient patient = mock(Patient.class);
	when(patientRepository.findByUsername(anyString())).thenReturn(patient);
	when(patient.getEmail()).thenReturn(emailAddress);
	passwordResetTokenExpireInHours = 5;
	sut = new PasswordResetServiceImpl(passwordResetTokenExpireInHours,
			usersRepository, patientRepository, staffRepository,
			tokenGenerator, passwordResetTokenRepository, emailSender,
			passwordEncoder);
	// Act
	sut.createPasswordResetToken("username", emailAddress,
			resetPasswordLinkPlaceHolder);
	// Assert
	verify(passwordResetTokenRepository, times(1)).save(
			argThat(new IsPasswordResetTokenWithCorrectExpireInHours(
					passwordResetTokenExpireInHours)));
}