Skip to content

Conversation

bdemers
Copy link
Member

@bdemers bdemers commented Feb 4, 2024

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.

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 bdemers requested a review from elecharny February 4, 2024 16:12
@bdemers bdemers marked this pull request as draft February 4, 2024 16:18
@bdemers
Copy link
Member Author

bdemers commented Feb 4, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant