};
validator = Validation.buildDefaultValidatorFactory().getValidator();
userRepository = mock(UserRepository.class);
tokenRepository = mock(VerificationTokenRepository.class);
ApplicationConfig config = mock(ApplicationConfig.class);
verificationTokenService = new VerificationTokenServiceImpl(userRepository, tokenRepository,
emailServicesGateway, validator);
((VerificationTokenServiceImpl)verificationTokenService).setConfig(config);
when(config.getHostNameUrl()).thenReturn(new String("http://localhost:8080"));
when(config.getLostPasswordTokenExpiryTimeInMinutes()).thenReturn(120);
when(config.getEmailVerificationTokenExpiryTimeInMinutes()).thenReturn(120);
when(config.getEmailRegistrationTokenExpiryTimeInMinutes()).thenReturn(120);
}