Search in sources :

Example 6 with AndRequestMatcher

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

the class AndRequestMatcherTests method matchesMultiTrue.

@Test
public void matchesMultiTrue() {
    when(delegate.matches(request)).thenReturn(true);
    when(delegate2.matches(request)).thenReturn(true);
    matcher = new AndRequestMatcher(delegate, delegate2);
    assertThat(matcher.matches(request)).isTrue();
}
Also used : AndRequestMatcher(org.springframework.security.web.util.matcher.AndRequestMatcher) Test(org.junit.Test)

Example 7 with AndRequestMatcher

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

the class AndRequestMatcherTests method matchesMultiBothFalse.

@Test
public void matchesMultiBothFalse() {
    when(delegate.matches(request)).thenReturn(false);
    when(delegate2.matches(request)).thenReturn(false);
    matcher = new AndRequestMatcher(delegate, delegate2);
    assertThat(matcher.matches(request)).isFalse();
}
Also used : AndRequestMatcher(org.springframework.security.web.util.matcher.AndRequestMatcher) Test(org.junit.Test)

Example 8 with AndRequestMatcher

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

the class AndRequestMatcherTests method matchesSingleFalse.

@Test
public void matchesSingleFalse() {
    when(delegate.matches(request)).thenReturn(false);
    matcher = new AndRequestMatcher(delegate);
    assertThat(matcher.matches(request)).isFalse();
}
Also used : AndRequestMatcher(org.springframework.security.web.util.matcher.AndRequestMatcher) Test(org.junit.Test)

Aggregations

AndRequestMatcher (org.springframework.security.web.util.matcher.AndRequestMatcher)8 Test (org.junit.Test)5 MediaTypeRequestMatcher (org.springframework.security.web.util.matcher.MediaTypeRequestMatcher)3 NegatedRequestMatcher (org.springframework.security.web.util.matcher.NegatedRequestMatcher)3 RequestHeaderRequestMatcher (org.springframework.security.web.util.matcher.RequestHeaderRequestMatcher)3 RequestMatcher (org.springframework.security.web.util.matcher.RequestMatcher)3 ContentNegotiationStrategy (org.springframework.web.accept.ContentNegotiationStrategy)3 HeaderContentNegotiationStrategy (org.springframework.web.accept.HeaderContentNegotiationStrategy)3 ArrayList (java.util.ArrayList)1 MediaType (org.springframework.http.MediaType)1 AntPathRequestMatcher (org.springframework.security.web.util.matcher.AntPathRequestMatcher)1 OrRequestMatcher (org.springframework.security.web.util.matcher.OrRequestMatcher)1