140141142143144145146
} matchers.add(notFavIcon); matchers.add(notJson); matchers.add(notXRequestedWith); return new AndRequestMatcher(matchers); }
49505152535455
private RequestMatcher matcher; @Test(expected = NullPointerException.class) public void constructorNullArray() { new AndRequestMatcher((RequestMatcher[]) null); }
54555657585960
new AndRequestMatcher((RequestMatcher[]) null); } @Test(expected = IllegalArgumentException.class) public void constructorArrayContainsNull() { new AndRequestMatcher((RequestMatcher)null); }
59606162636465
new AndRequestMatcher((RequestMatcher)null); } @Test(expected = IllegalArgumentException.class) public void constructorEmptyArray() { new AndRequestMatcher(new RequestMatcher[0]); }
64656667686970
new AndRequestMatcher(new RequestMatcher[0]); } @Test(expected = IllegalArgumentException.class) public void constructorNullList() { new AndRequestMatcher((List<RequestMatcher>) null); }
69707172737475
new AndRequestMatcher((List<RequestMatcher>) null); } @Test(expected = IllegalArgumentException.class) public void constructorListContainsNull() { new AndRequestMatcher(Arrays.asList((RequestMatcher)null)); }
74757677787980
new AndRequestMatcher(Arrays.asList((RequestMatcher)null)); } @Test(expected = IllegalArgumentException.class) public void constructorEmptyList() { new AndRequestMatcher(Collections.<RequestMatcher>emptyList()); }
808182838485868788
} @Test public void matchesSingleTrue() { when(delegate.matches(request)).thenReturn(true); matcher = new AndRequestMatcher(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 AndRequestMatcher(delegate, delegate2); assertThat(matcher.matches(request)).isTrue(); }
9899100101102103104105106
@Test public void matchesSingleFalse() { when(delegate.matches(request)).thenReturn(false); matcher = new AndRequestMatcher(delegate); assertThat(matcher.matches(request)).isFalse(); }