As part of adding the root DSE handler to the ldap simulator, I found that my bindings were getting out of sync because the after each hook was not attached to the appropriate scope. Since this is Effection, and we can use resources that automatically teardown after every test, let's make this implicit, that way our tests can be more flexible.
Approach
This takes out the raw usage of the LDAP client, and wraps it in a resource. Specifically, in order to get to the ldap client, you must first bind() and then you can execute commands such as search. search() itself has been implemented as a stream which makes working with it a lot nicer.
Motivation
As part of adding the root DSE handler to the ldap simulator, I found that my bindings were getting out of sync because the after each hook was not attached to the appropriate scope. Since this is Effection, and we can use resources that automatically teardown after every test, let's make this implicit, that way our tests can be more flexible.
Approach
This takes out the raw usage of the LDAP client, and wraps it in a resource. Specifically, in order to get to the ldap client, you must first
bind()
and then you can execute commands such assearch
.search()
itself has been implemented as a stream which makes working with it a lot nicer.