@Test
public void testCreatePasswordResetToken_Email_Is_Sent_Successfully()
		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);
	sut = new PasswordResetServiceImpl(passwordResetTokenExpireInHours,
			usersRepository, patientRepository, staffRepository,
			tokenGenerator, passwordResetTokenRepository, emailSender,
			passwordEncoder);
	// Act
	sut.createPasswordResetToken("username", emailAddress,
			resetPasswordLinkPlaceHolder);
	// Assert
	verify(emailSender, times(1)).sendMessage(anyString(), anyString(),
			eq(EmailType.PASSWORD_RESET_REQUEST), anyString(), anyString());
}