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
however there is an aspect missing, unit testing. When using @WebMvcTest we discover that the AadResourceServerWebSecurityConfigurerAdapter needs a properties bean AadResourceServerProperties that doesn't seem to be initialized with the slim context.
Describe the solution you'd like
I would like a set of simple tests using @WebMvcTest that would exercise the mappings using the spring security test mechanisms of @WithMockUser, @WithUserDetails, and/or @WithSecurityContext
Describe alternatives you've considered
I am trying to write these now.
I also have a full integration version which exposes a random port and uses the TestRestTemplate to make a call with a custom SecurityContextRepository, however we should be able to easily apply the slim @WebMvcTest context as well.
Additional context
IMHO the appropriate approach to testing is a critical part of a complete example.
Information Checklist
Description Added
Expected solution specified
The text was updated successfully, but these errors were encountered:
Thanks @arranbartish that is exactly what I was looking for.
Do you have sample code of how you setup the Integration tests? I am currently stuck at this point.
Is your feature request related to a problem? Please describe.
This is described as a complete example.
learn.microsft.com
however there is an aspect missing, unit testing. When using
@WebMvcTest
we discover that theAadResourceServerWebSecurityConfigurerAdapter
needs a properties beanAadResourceServerProperties
that doesn't seem to be initialized with the slim context.Describe the solution you'd like
I would like a set of simple tests using
@WebMvcTest
that would exercise the mappings using the spring security test mechanisms of@WithMockUser
,@WithUserDetails
, and/or@WithSecurityContext
Describe alternatives you've considered
I am trying to write these now.
I also have a full integration version which exposes a random port and uses the
TestRestTemplate
to make a call with a customSecurityContextRepository
, however we should be able to easily apply the slim@WebMvcTest
context as well.Additional context
IMHO the appropriate approach to testing is a critical part of a complete example.
Information Checklist
The text was updated successfully, but these errors were encountered: