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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in other requests, I ended with a solution involving a parent class for all my controllers unit tests, which mocks TokenStore so that it recognizes a specific Authorization header and creates OAuth2Authorization according to what is configured with @WithMockOAuth2Client and @WithMockOAuth2User
ch4mpy
changed the title
Have unit test TokenStore set-up OAuth2 authentication as configured with test annotations
Have unit test OAuth2 authentication configured with annotations
Feb 24, 2019
Summary
Default token store has no knowledge of test configured authentication
Actual Behavior
OAuth2Athentication is anonymous, whatever I try to configure it with @WithMockUser or alike
Expected Behavior
When a test is decorated with authentication meta-data, OAuth2Athentication should be set-up accordingly
linked requests
As mentioned in other requests, I ended with a solution involving a parent class for all my controllers unit tests, which mocks TokenStore so that it recognizes a specific Authorization header and creates OAuth2Authorization according to what is configured with
@WithMockOAuth2Client
and@WithMockOAuth2User
Sample
Overall result in controller unit tests:
The text was updated successfully, but these errors were encountered: