-
Notifications
You must be signed in to change notification settings - Fork 260
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
Move TogglzTestExecutionListener out of togglz-spring-core module #997
Comments
You actually don't have to mock it. Togglz ships with a special module for unit testing feature toggles: https://www.togglz.org/documentation/testing.html |
I know well about this testing feature provided by togglze, but in our controller test, I would like to isolate any dependencies and focus on request/response verfication. Unfortunately, we can not mock featureManager there due to the togglz TestExecutionListener. |
And if I provide custom State Repository, User Repository, Activation Strategy implementations, and then the togglz testing harness becomes heavy, I do not want to hit database when testing controllers. |
When added togglz spring boot stater and use I also created an issue on Spring framework to avoid the useless test listeners that affected my tests. spring-projects/spring-framework#30321 |
As I mentioned in spring-projects/spring-framework#30321 (comment):
In light of that, perhaps the Togglz team would consider introducing a test annotation to control/trigger the behavior of the |
8000
edited
When adding starter into the project, the TogglzTestExecutionListener will be enabled by default for tests, and it is better to move it standalone module(eg.
togglz-spring-test
) and allow developers to add it manually.Additionally when I try to mock
FeatureManager
in my tests it always fails my mocks.The text was updated successfully, but these errors were encountered: