How can I setup an embedded ApacheDS in Junit5

234 Views Asked by At

In the ApacheDS documentation about embedding an ApacheDS server in Junit test they only mentions example for Junit4 using

@RunWith(FrameworkRunner.class)

or

@ClassRule
public static CreateLdapServerRule serverRule = new CreateLdapServerRule();

But RunWith and ClassRule are not available in Junit5.

How can I run Junit5 tests with an embedded ApacheDS LdapServer ?

1

There are 1 best solutions below

0
bersti On

Using apacheds-test-framework >= 2.0.0.AM27 you can use

@ExtendWith(ApacheDSTestExtension.class)