I have a Spring MVC + Spring Security Web application. The application has a custom session authentication strategy set up in the configuration
http.sessionManagement()
.sessionAuthenticationStrategy( ... )
Since the strategy contains complex logic, it's important to test its behaviour via integrational tests.
When we use spring-security-test @WithMockUser the controller method is being called in tests, however our authentication strategy is not called.
What's the correct way to enforce full authentication process in Spring Security tests to ensure that session authentication strategy is indeed called?
Or to paraphrase: how to call the whole spring security filter chain?
Thanks for ideas.