Skip to content

Commit 8b1a1a0

Browse files
committed
update docs
Closes #938 Signed-off-by: emanueltrandafir1993 <emanueltrandafir1993@gmail.com>
1 parent 3b610b0 commit 8b1a1a0

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

modules/ROOT/pages/testing.adoc

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ The following bean definition creates an embedded LDAP server:
109109
====
110110
[source,xml]
111111
----
112-
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.EmbeddedLdapServerFactoryBean">
112+
<bean id="embeddedAlso, `org.springframework.ldap.test.unboundid.LdapTestUtils` provide methods to programmatically work with an embedded LDAP server.
113+
Also, `org.springframework.ldap.test.unboundid.LdapTestUtils` provide methods to programmatically work with an embedded LDAP server.
114+
" class="org.springframework.ldap.test.EmbeddedLdapServerFactoryBean">
113115
<property name="partitionName" value="example"/>
114116
<property name="partitionSuffix" value="dc=261consulting,dc=com" />
115117
<property name="port" value="9321" />
@@ -182,17 +184,20 @@ testCompile "com.unboundid:unboundid-ldapsdk:3.1.1"
182184
The following bean definition creates an embedded LDAP server:
183185

184186
====
185-
[source,xml]
187+
[source,java]
186188
----
187-
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.unboundid.EmbeddedLdapServerFactoryBean">
188-
<property name="partitionName" value="example"/>
189-
<property name="partitionSuffix" value="dc=261consulting,dc=com" />
190-
<property name="port" value="9321" />
191-
</bean>
189+
@Bean
190+
EmbeddedLdapServer embeddedLdapServer() {
191+
return EmbeddedLdapServer.builder()
192+
.withPort(18881)
193+
.withPartitionName("jayway")
194+
.withPartitionSuffix("dc=jayway,dc=se")
195+
.withConfigurationCustomizer((config) -> config.setCodeLogDetails(tempLogFile, true))
196+
.build();
197+
}
192198
----
193-
====
194199
195-
`spring-ldap-test` provides a way to populate the LDAP server by using `org.springframework.ldap.test.unboundid.LdifPopulator`. To use it, create a bean similar to the following:
200+
Alternatively, you can use the `org.springframework.ldap.test.unboundid.LdifPopulator` to create and populate the LDAP server. To use it, create a bean similar to the following:
196201
197202
====
198203
[source,xml]

test-support/src/test/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServerBuilderTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
import static org.assertj.core.api.Assertions.assertThat;
3535

36-
3736
public class EmbeddedLdapServerBuilderTests {
3837

3938
private static String tempLogFile;

0 commit comments

Comments
 (0)