This pr aims to fix#66. The problem is that FinatraServer assigns the value of service during construction, which doesn't leave any chance for the additional filters that are added later to be taken into account. Making this field lazy fixes the problem.
Testing this change without exposing the service turned out to be difficult. I tried my best but I am aware that the test is not the healthiest one.
@twoism I actually wanted to write the test this way but the SpecHelper does not take the filters into account and furthermore the appService is not exposed therefore I could not find an easy way to test the filters as you described. However if I can refactor the SpecHelper then I can write a better test. I will try to do it soon-ish.
I was just looking at this as well. We should definitely have a filters spec so refactoring of the SpecHelper may need to happen. thanks for catching this!
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
This pr aims to fix #66. The problem is that FinatraServer assigns the value of service during construction, which doesn't leave any chance for the additional filters that are added later to be taken into account. Making this field
lazy
fixes the problem.Testing this change without exposing the service turned out to be difficult. I tried my best but I am aware that the test is not the healthiest one.