Security combined with JUnit causes registration error RequestMatcher
When I tried to use JUnit’s Mock to test the whitelist API, Security intercepted it. I found that the matching machine that should have been MvcRequestMatcher turned into SpringAntMatcher. Because when registering RequestMathcer, SpringBootMockServlet returned an empty Registration Map, which caused all RequestMatchers to be registered as SpringAntMatcher. How can I solve this problem.
enter image description here