public class Matchers extends Object
Constructor and Description |
---|
Matchers() |
Modifier and Type | Method and Description |
---|---|
static <T> org.hamcrest.Matcher<Collection<T>> |
containsOnly(org.hamcrest.Matcher<? super T>... matchers)
Creates a matcher that matches if the examined collection matches the specified items in any order
For example:
|
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
For example:
|
static <T> org.hamcrest.Matcher<Collection<T>> |
containsOnlyInOrder(org.hamcrest.Matcher<? super T>... matchers)
Creates a matcher that matches if the examined collection matches the specified matchers in order
For example:
|
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
For example:
|
public static <T> org.hamcrest.Matcher<Collection<T>> containsOnlyInOrder(org.hamcrest.Matcher<? super 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<? super 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 © 2024. All rights reserved.