diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java index c9eaf6d48c..c20bb1f947 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java @@ -101,8 +101,7 @@ public class LdapAutoConfigurationTests { @Test public void templateExists() { this.contextRunner.withPropertyValues("spring.ldap.urls:ldap://localhost:389") - .run(context -> assertThat( - context.getBeanNamesForType(LdapTemplate.class)).hasSize(1)); + .run(context -> assertThat(context).hasSingleBean(LdapTemplate.class)); } }