diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java index 80dd805b6e..82303f721b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java @@ -217,8 +217,8 @@ public class MongoProperties { if (hasCustomCredentials()) { String database = this.authenticationDatabase == null ? getMongoClientDatabase() : this.authenticationDatabase; - credentials = Arrays.asList(MongoCredential.createMongoCRCredential( - this.username, database, this.password)); + credentials = Arrays.asList(MongoCredential + .createCredential(this.username, database, this.password)); } String host = this.host == null ? "localhost" : this.host; int port = determinePort(environment);