use of jakarta.servlet.http.HttpServletRequest in project spring-security by spring-projects.
the class DispatcherTypeRequestMatcherTests method does_not_match_with_wrong_http_method.
@Test
public void does_not_match_with_wrong_http_method() {
HttpServletRequest request = mockHttpServletRequest(DispatcherType.ERROR, HttpMethod.GET);
DispatcherTypeRequestMatcher matcher = new DispatcherTypeRequestMatcher(DispatcherType.ERROR, HttpMethod.POST);
assertThat(matcher.matches(request)).isFalse();
}
use of jakarta.servlet.http.HttpServletRequest in project spring-security by spring-projects.
the class RegexRequestMatcherTests method requestHasNullMethodNoMatch.
// SEC-2084
@Test
public void requestHasNullMethodNoMatch() {
RegexRequestMatcher matcher = new RegexRequestMatcher("/something/.*", "GET");
HttpServletRequest request = createRequestWithNullMethod("/nomatch");
assertThat(matcher.matches(request)).isFalse();
}
use of jakarta.servlet.http.HttpServletRequest in project spring-security by spring-projects.
the class RegexRequestMatcherTests method requestHasNullMethodAndNullMatcherNoMatch.
@Test
public void requestHasNullMethodAndNullMatcherNoMatch() {
RegexRequestMatcher matcher = new RegexRequestMatcher("/something/.*", null);
HttpServletRequest request = createRequestWithNullMethod("/nomatch");
assertThat(matcher.matches(request)).isFalse();
}
use of jakarta.servlet.http.HttpServletRequest in project spring-security by spring-projects.
the class AntPathRequestMatcherTests method requestHasNullMethodNoMatch.
// SEC-2084
@Test
public void requestHasNullMethodNoMatch() {
AntPathRequestMatcher matcher = new AntPathRequestMatcher("/something/*", "GET");
HttpServletRequest request = createRequestWithNullMethod("/nomatch");
assertThat(matcher.matches(request)).isFalse();
}
use of jakarta.servlet.http.HttpServletRequest in project spring-security by spring-projects.
the class AntPathRequestMatcherTests method requestHasNullMethodMatches.
@Test
public void requestHasNullMethodMatches() {
AntPathRequestMatcher matcher = new AntPathRequestMatcher("/something/*", "GET");
HttpServletRequest request = createRequestWithNullMethod("/something/here");
assertThat(matcher.matches(request)).isTrue();
}
Aggregations