mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-12-26 18:13:37 +00:00
Added test scope for NPE in RequestMethod
Signed-off-by: Soumik Sarker <ronodhirsoumik@gmail.com>
This commit is contained in:
parent
1ce73dd45a
commit
244b5a16be
@ -146,6 +146,14 @@ public class PathPatternRequestMatcherTests {
|
||||
assertThat(matcher.matches(mock)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void matcherWhenRequestMethodIsNullThenNoNullPointerException() {
|
||||
RequestMatcher matcher = pathPattern(HttpMethod.GET, "/");
|
||||
MockHttpServletRequest mock = new MockHttpServletRequest(null, "/");
|
||||
ServletRequestPathUtils.parseAndCache(mock);
|
||||
assertThat(matcher.matches(mock)).isFalse();
|
||||
}
|
||||
|
||||
MockHttpServletRequest request(String uri) {
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("GET", uri);
|
||||
ServletRequestPathUtils.parseAndCache(request);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user