public class Matchers extends Object
| Constructor | Description |
|---|---|
Matchers() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> org.hamcrest.Matcher<Collection<T>> |
containsOnly(org.hamcrest.Matcher<? extends T>... matchers) |
Creates a matcher that matches if the examined collection matches the specified items in any order
|
static <T> org.hamcrest.Matcher<Collection<T>> |
containsOnly(T... items) |
Creates a matcher that matches if the examined collection matches the specified items in any order
|
static <T> org.hamcrest.Matcher<Collection<T>> |
containsOnlyInOrder(org.hamcrest.Matcher<? extends T>... matchers) |
Creates a matcher that matches if the examined collection matches the specified matchers in order
|
static <T> org.hamcrest.Matcher<Collection<T>> |
containsOnlyInOrder(T... items) |
Creates a matcher that matches if the examined collection matches the specified items in order
|
public static <T> org.hamcrest.Matcher<Collection<T>> containsOnlyInOrder(org.hamcrest.Matcher<? extends T>... matchers)
assertThat(Arrays.asList("foo", "bar"), containsOnlyInOrder(startsWith("f"), endsWith("ar")))public static <T> org.hamcrest.Matcher<Collection<T>> containsOnlyInOrder(T... items)
assertThat(Arrays.asList("foo", "bar"), containsOnlyInOrder("foo", "bar"))public static <T> org.hamcrest.Matcher<Collection<T>> containsOnly(org.hamcrest.Matcher<? extends T>... matchers)
assertThat(Arrays.asList("bar", "foo"), containsOnly(startsWith("f"), endsWith("ar")))public static <T> org.hamcrest.Matcher<Collection<T>> containsOnly(T... items)
assertThat(Arrays.asList("bar", "foo"), containsOnly("foo", "bar"))Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.