|
1 | 1 | package org.hamcrest.collection; |
2 | 2 |
|
| 3 | +import static org.hamcrest.collection.IsCollectionContaining.hasItem; |
3 | 4 | import org.hamcrest.AbstractMatcherTest; |
4 | 5 | import org.hamcrest.Matcher; |
5 | 6 | import static org.hamcrest.collection.IsCollectionContaining.hasItems; |
|
11 | 12 | public class IsCollectionContainingTest extends AbstractMatcherTest { |
12 | 13 |
|
13 | 14 | protected Matcher<?> createMatcher() { |
14 | | - return IsCollectionContaining.hasItem(equalTo("irrelevant")); |
| 15 | + return hasItem(equalTo("irrelevant")); |
15 | 16 | } |
16 | 17 |
|
17 | 18 | public void testMatchesACollectionThatContainsAnElementMatchingTheGivenMatcher() { |
18 | 19 | assertMatches("should matches list that contains 'a'", |
19 | | - IsCollectionContaining.hasItem(equalTo("a")), asList("a", "b", "c")); |
| 20 | + hasItem(equalTo("a")), asList("a", "b", "c")); |
20 | 21 | } |
21 | 22 |
|
22 | 23 | public void testDoesNotMatchCollectionThatDoesntContainAnElementMatchingTheGivenMatcher() { |
23 | 24 | assertDoesNotMatch("should not matches list that doesn't contain 'a'", |
24 | | - IsCollectionContaining.hasItem(equalTo("a")), asList("b", "c")); |
| 25 | + hasItem(equalTo("a")), asList("b", "c")); |
25 | 26 | assertDoesNotMatch("should not matches empty list", |
26 | | - IsCollectionContaining.hasItem(equalTo("a")), new ArrayList<String>()); |
| 27 | + hasItem(equalTo("a")), new ArrayList<String>()); |
27 | 28 | } |
28 | 29 |
|
29 | 30 | public void testDoesNotMatchNull() { |
30 | | - assertDoesNotMatch("should not matches null", IsCollectionContaining.hasItem(equalTo("a")), null); |
| 31 | + assertDoesNotMatch("should not matches null", hasItem(equalTo("a")), null); |
31 | 32 | } |
32 | 33 |
|
33 | 34 | public void testHasAReadableDescription() { |
34 | | - assertDescription("a collection containing \"a\"", IsCollectionContaining.hasItem(equalTo("a"))); |
| 35 | + assertDescription("a collection containing \"a\"", hasItem(equalTo("a"))); |
35 | 36 | } |
36 | 37 |
|
37 | 38 | public void testMatchesAllItemsInCollection() { |
|
0 commit comments