Search in sources :

Example 6 with ELRequestMatcher

use of org.springframework.security.web.util.matcher.ELRequestMatcher in project spring-security by spring-projects.

the class ELRequestMatcherTests method testHasHeaderNull.

@Test
public void testHasHeaderNull() throws Exception {
    ELRequestMatcher requestMatcher = new ELRequestMatcher("hasHeader('User-Agent','MSIE')");
    MockHttpServletRequest request = new MockHttpServletRequest();
    assertThat(requestMatcher.matches(request)).isFalse();
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) ELRequestMatcher(org.springframework.security.web.util.matcher.ELRequestMatcher) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)6 ELRequestMatcher (org.springframework.security.web.util.matcher.ELRequestMatcher)6