Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CreateDSTesetExtension no longer requires a parent test class #145

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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 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
1 participant