Spring Security's SecurityContext get unexpectedly cleared in a MockMvc Test
Jun 14, 2025 · 3 min read · Background At work, there’s some test written where I wanted to query the database (repository) after mockMvc request has been made to verify the result. This is a very simple illustration of what it looks like. @SpringBootTest @AutoConfigureMockMvc ...
Join discussion



