Buggy code:
@ Configuration @ Import ( { CommonSpringConfiguration . class , OAuthSpringConfiguration . class , PlayerTokenSpringConfiguration . class , RedisSpringConfiguration . class , MongoSpringConfiguration . class , RegistrationSpringConfiguration . Default . class , RegistrationSpringConfiguration . Cloud . class } ) public class RegistrationSpringConfiguration implements SpringConfiguration { @ Bean public PlayerKeyGenerator playerKeyGenerator ( ServerPlayerCredentialRepository credentialRepository ) { } @ Bean public ServerPlayerCredentialRepository playerCredentialRepository ( MongoRepositoryFactory mongoRepositoryFactory ) { } @ Bean public ClembleConsumerDetailsService clembleConsumerDetailsService ( ) { } @ Bean public PasswordEncoder passwordEncoder ( ) { } @ Bean public PlayerManualRegistrationController playerRegistrationController ( ServerPlayerCredentialManager credentialManager , PlayerTokenUtils tokenUtils , @ Qualifier ( "playerKeyGenerator" ) PlayerKeyGenerator playerKeyGenerator , ClembleConsumerDetailsService clembleConsumerDetailsService , ClembleCasinoValidationService clembleValidationService , PlayerTokenFactory playerTokenFactory , SystemNotificationService systemNotificationService ) throws NoSuchAlgorithmException { } @ Bean public ServerPlayerCredentialManager credentialManager ( PasswordEncoder passwordEncoder , ServerPlayerCredentialRepository credentialRepository ) { } @ Bean public PlayerBaseRegistrationController playerBaseRegistrationController ( PlayerTokenUtils tokenUtils , @ Qualifier ( "playerRegistrationController" ) PlayerManualRegistrationService manualRegistrationService ) { } @ Bean public PlayerTokenUtils tokenUtils ( @ Value ( "${clemble.registration.token.host}" ) String host , @ Value ( "${clemble.registration.token.maxAge}" ) int maxAge ) { } @ Bean public PlayerSignOutServiceController playerSignOutServiceController ( @ Value ( "${clemble.registration.token.host}" ) String host , PlayerTokenUtils tokenUtils ) { } @ Bean public PlayerPasswordResetServiceController passwordResetServiceController ( PasswordResetTokenService tokenService , ServerPlayerCredentialManager credentialManager ) { } @ Bean public PasswordResetTokenService passwordResetTokenService ( @ Value ( "${clemble.registration.token.host}" ) String host , @ Qualifier ( "passwordTextEncryptor" ) TextEncryptor textEncryptor , PasswordResetTokenGenerator tokenGenerator , ServerPasswordResetTokenRepository tokenRepository , SystemNotificationService notificationService ) { <START_BUG> return new PasswordResetTokenService ( host , textEncryptor , tokenGenerator , tokenRepository , notificationService ) ; <END_BUG> } @ Bean public PasswordResetTokenGenerator passwordResetTokenGenerator ( ) { } @ Bean public ServerPasswordResetTokenRepository serverPasswordResetTokenRepository ( MongoRepositoryFactory mongoRepositoryFactory ) { } @ Configuration @ Profile ( { SpringConfiguration . TEST , SpringConfiguration . DEFAULT , SpringConfiguration . INTEGRATION_TEST } ) public static class Default implements SpringConfiguration { @ Bean public TextEncryptor passwordTextEncryptor ( ) { } } @ Configuration @ Profile ( SpringConfiguration . CLOUD ) public static class Cloud implements SpringConfiguration { @ Bean public TextEncryptor passwordTextEncryptor ( @ Value ( "${clemble.password.encryptor.password}" ) String password , @ Value ( "${clemble.password.encryptor.salt}" ) String salt ) { } } }

Fix:
return new PasswordResetTokenService ( ( "http:////" + ( host . substring ( 1 ) ) ) , textEncryptor , tokenGenerator , tokenRepository , notificationService ) ;