Polish
This commit is contained in:
@@ -50,8 +50,10 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void testSetDefaultPort() {
|
||||
this.contextRunner.withPropertyValues("spring.ldap.embedded.port:1234",
|
||||
"spring.ldap.embedded.base-dn:dc=spring,dc=org").run(context -> {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.ldap.embedded.port:1234",
|
||||
"spring.ldap.embedded.base-dn:dc=spring,dc=org")
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
assertThat(server.getListenPort()).isEqualTo(1234);
|
||||
@@ -62,7 +64,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
public void testRandomPortWithEnvironment() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.ldap.embedded.base-dn:dc=spring,dc=org")
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
assertThat(server.getListenPort()).isEqualTo(context.getEnvironment()
|
||||
@@ -90,7 +92,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
.withPropertyValues("spring.ldap.embedded.base-dn:dc=spring,dc=org",
|
||||
"spring.ldap.embedded.credential.username:uid=root",
|
||||
"spring.ldap.embedded.credential.password:boot")
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
BindResult result = server.bind("uid=root", "boot");
|
||||
@@ -102,7 +104,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
public void testSetPartitionSuffix() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.ldap.embedded.base-dn:dc=spring,dc=org")
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
assertThat(server.getBaseDNs())
|
||||
@@ -114,7 +116,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
public void testSetLdifFile() {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.ldap.embedded.base-dn:dc=spring,dc=org")
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
assertThat(server
|
||||
@@ -129,7 +131,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
.withPropertyValues("spring.ldap.embedded.base-dn:dc=spring,dc=org")
|
||||
.withConfiguration(AutoConfigurations.of(LdapAutoConfiguration.class,
|
||||
LdapDataAutoConfiguration.class))
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
assertThat(context.getBeanNamesForType(LdapTemplate.class).length)
|
||||
.isEqualTo(1);
|
||||
LdapTemplate ldapTemplate = context.getBean(LdapTemplate.class);
|
||||
@@ -143,7 +145,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
this.contextRunner
|
||||
.withPropertyValues("spring.ldap.embedded.validation.enabled:false",
|
||||
"spring.ldap.embedded.base-dn:dc=spring,dc=org")
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
assertThat(server.getSchema()).isNull();
|
||||
@@ -155,7 +157,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
this.contextRunner.withPropertyValues(
|
||||
"spring.ldap.embedded.validation.schema:classpath:custom-schema.ldif",
|
||||
"spring.ldap.embedded.ldif:classpath:custom-schema-sample.ldif",
|
||||
"spring.ldap.embedded.base-dn:dc=spring,dc=org").run(context -> {
|
||||
"spring.ldap.embedded.base-dn:dc=spring,dc=org").run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
|
||||
@@ -174,7 +176,7 @@ public class EmbeddedLdapAutoConfigurationTests {
|
||||
"spring.ldap.embedded.ldif:classpath:schema-multi-basedn.ldif",
|
||||
"spring.ldap.embedded.base-dn[0]:dc=spring,dc=org",
|
||||
"spring.ldap.embedded.base-dn[1]:dc=pivotal,dc=io")
|
||||
.run(context -> {
|
||||
.run((context) -> {
|
||||
InMemoryDirectoryServer server = context
|
||||
.getBean(InMemoryDirectoryServer.class);
|
||||
assertThat(server
|
||||
|
||||
@@ -41,7 +41,7 @@ public class WebFluxSecurityConfigurationTests {
|
||||
this.contextRunner
|
||||
.withUserConfiguration(WebFilterChainProxyConfiguration.class,
|
||||
WebFluxSecurityConfiguration.class)
|
||||
.run(context -> assertThat(context)
|
||||
.run((context) -> assertThat(context)
|
||||
.doesNotHaveBean(WebFluxSecurityConfiguration.class));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user