AntPathRequestMatcher与MockHttpServletRequest不匹配

时间:2019-11-06 16:27:40

标签: java spring spring-security spring-test

为什么AntPathRequestMatcher与该MockHttpServletRequest不匹配?我希望以下测试通过:

@Test
public void matcherMatches() {
    MockHttpServletRequest req = new MockHttpServletRequest("GET", "/login");
    AntPathRequestMatcher matcher = new AntPathRequestMatcher("/login/**");
    Assert.assertTrue(matcher.matches(req));
}

但事实并非如此-我缺少MockHttpServletRequest方面的信息?

0 个答案:

没有答案
相关问题