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 described in this request, I came-up with a solution: @WithMockOAuth2Client to mock direct client connection and @WithMockOAuth2User to mock a client connected on behalf of an end-user (relies on both @WithMockOAuth2Client and @WithMockUser).
ch4mpy
changed the title
@WithMockUser alike annotations for OAuth2 authentications
@WithMockUser alike annotations for OAuth2 authentications
Feb 24, 2019
ch4mpy
changed the title
@WithMockUser alike annotations for OAuth2 authentications
@WithMockUser alike annotations for OAuth2
Feb 24, 2019
Summary
Provide with tooling to set-up properly mocked
OAuth2Authentication
when writing unit testsActual Behavior
@WithMockUser
is not quite enough to mock Auth2 authenticationExpected Behavior
When I write controller unit tests, I wish I could mock any aspect of OAuth2 authentication (being direct client auth or on behalf of an end-user)
linked requests
Sample
As described in this request, I came-up with a solution:
@WithMockOAuth2Client
to mock direct client connection and@WithMockOAuth2User
to mock a client connected on behalf of an end-user (relies on both@WithMockOAuth2Client
and@WithMockUser
).Overall result in controller unit tests:
The text was updated successfully, but these errors were encountered: