directory-server icon indicating copy to clipboard operation
directory-server copied to clipboard

The CreateDSTesetExtension no longer requires a parent test class

Open bdemers opened this issue 1 year ago • 1 comments

The previous behavior of the extension required the use AbstractLdapTestUnit or duplicating static variables named classDirectoryService/methodDirectoryService

Now the directoryService can be injected into the test as a parameter, e.g.

void myTest( DirectoryService directoryService ) { ... }

A class level or method level DirectoryService will be injected automatically

NOTE: The previous behavior will still work to ensure backward compatiblity.

bdemers avatar Feb 04 '24 16:02 bdemers

While creating a SCIMple + ApacheDS example, I ran into a few minor issues trying to use the extension without using AbstractLdapTestUnit, I had to copy a bunch of static fields into my test class. This should allow for the tests to inject the directory service automatically.

NOTE: I only updated CreateDSTestExtension, I'm guessing the other extensions should be updated too, but It wasn't clear to me what the difference between them was? @elecharny, can you provide some guidance on the various extensions, and I'll see if the same technique can be used.

Also, do we care about the backward compatibility here? If not, I can cleanup the code a bit more (and still keep the functionality of AbstractLdapTestUnit)

bdemers avatar Feb 04 '24 16:02 bdemers