13131314131513161317131813191320
* @since 3.2 */ public final class RequestMatcherConfigurer extends AbstractRequestMatcherRegistry<RequestMatcherConfigurer> { protected RequestMatcherConfigurer chainRequestMatchers(List<RequestMatcher> requestMatchers) { requestMatcher(new OrRequestMatcher(requestMatchers)); return this; }
49505152535455
private RequestMatcher matcher; @Test(expected = NullPointerException.class) public void constructorNullArray() { new OrRequestMatcher((RequestMatcher[]) null); }
54555657585960
new OrRequestMatcher((RequestMatcher[]) null); } @Test(expected = IllegalArgumentException.class) public void constructorArrayContainsNull() { new OrRequestMatcher((RequestMatcher)null); }
59606162636465
new OrRequestMatcher((RequestMatcher)null); } @Test(expected = IllegalArgumentException.class) public void constructorEmptyArray() { new OrRequestMatcher(new RequestMatcher[0]); }
64656667686970
new OrRequestMatcher(new RequestMatcher[0]); } @Test(expected = IllegalArgumentException.class) public void constructorNullList() { new OrRequestMatcher((List<RequestMatcher>) null); }
69707172737475
new OrRequestMatcher((List<RequestMatcher>) null); } @Test(expected = IllegalArgumentException.class) public void constructorListContainsNull() { new OrRequestMatcher(Arrays.asList((RequestMatcher)null)); }
74757677787980
new OrRequestMatcher(Arrays.asList((RequestMatcher)null)); } @Test(expected = IllegalArgumentException.class) public void constructorEmptyList() { new OrRequestMatcher(Collections.<RequestMatcher>emptyList()); }
808182838485868788
} @Test public void matchesSingleTrue() { when(delegate.matches(request)).thenReturn(true); matcher = new OrRequestMatcher(delegate); assertThat(matcher.matches(request)).isTrue(); }
899091929394959697
@Test public void matchesMultiTrue() { when(delegate.matches(request)).thenReturn(true); when(delegate2.matches(request)).thenReturn(true); matcher = new OrRequestMatcher(delegate, delegate2); assertThat(matcher.matches(request)).isTrue(); }
9899100101102103104105106
@Test public void matchesSingleFalse() { when(delegate.matches(request)).thenReturn(false); matcher = new OrRequestMatcher(delegate); assertThat(matcher.matches(request)).isFalse(); }