| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | any(Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified |
| public static <T> AnyOf | |
| public static <T> AnyOf | |
| public static <T> AnyOf | |
| public static <T> AnyOf | |
| public static <T> AnyOf | |
| public static <T> AnyOf | |
| public static <T> AnyOf | |
| public static Matcher | |
| public static Matcher | |
| public static <LHS> CombinableMatcher. | |
| public static Matcher | containsString(String
the substring that the returned matcher will expect to find within any examined string substring)Creates a matcher that matches if the examined |
| public static <T> Matcher | describedAs(String
the new description for the wrapped matcher description, Matcher<T> the matcher to wrap matcher, Object... optional values to insert into the tokenised description values)Wraps an existing matcher, overriding its description with that specified. |
| public static <LHS> CombinableMatcher. | |
| public static Matcher | |
| public static <T> Matcher | equalTo(T operand)
Creates a matcher that matches when the examined object is logically equal to the specified
|
| public static <U> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | hasItems(Matcher<? super T>...
the matchers to apply to items provided by the examined itemMatchers)IterableCreates a matcher for |
| public static <T> Matcher | instanceOf(Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | not(T
the value that any examined object should not equal value)A shortcut to the frequently used |
| public static Matcher | |
| public static <T> Matcher | notNullValue(Class<T>
dummy parameter used to infer the generic type of the returned matcher type)A shortcut to the frequently used |
| public static Matcher | |
| public static <T> Matcher | |
| public static <T> Matcher | sameInstance(T
the target instance against which others should be assessed target)Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
| public static Matcher | startsWith(String
the substring that the returned matcher will expect at the start of any examined string prefix)Creates a matcher that matches if the examined |
| public static <T> Matcher | theInstance(T
the target instance against which others should be assessed target)Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
| CoreMatchers | back to summary |
|---|---|
| public CoreMatchers() | |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| allOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example: assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
| |
| any | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches when the examined object is an instance of the specified The created matcher forces a relationship between specified type and the examined object, and should be
used when it is necessary to make generics conform, for example in the JMock clause
For example: assertThat(new Canoe(), instanceOf(Canoe.class)); | |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anyOf | back to summary |
|---|---|
| public static <T> AnyOf Creates a matcher that matches if the examined object matches ANY of the specified matchers. For example: assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
| |
| anything | back to summary |
|---|---|
| public static Matcher Creates a matcher that always matches, regardless of the examined object. | |
| anything | back to summary |
|---|---|
| public static Matcher Creates a matcher that always matches, regardless of the examined object, but describes
itself with the specified | |
| both | back to summary |
|---|---|
| public static <LHS> CombinableMatcher. Creates a matcher that matches when both of the specified matchers match the examined object. For example: assertThat("fab", both(containsString("a")).and(containsString("b")))
| |
| containsString | back to summary |
|---|---|
| public static Matcher Creates a matcher that matches if the examined For example: assertThat("myStringOfNote", containsString("ring"))
| |
| describedAs | back to summary |
|---|---|
| public static <T> Matcher Wraps an existing matcher, overriding its description with that specified. All other functions are delegated to the decorated matcher, including its mismatch description. For example: describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
| |
| either | back to summary |
|---|---|
| public static <LHS> CombinableMatcher. Creates a matcher that matches when either of the specified matchers match the examined object. For example: assertThat("fan", either(containsString("a")).and(containsString("b")))
| |
| endsWith | back to summary |
|---|---|
| public static Matcher Creates a matcher that matches if the examined For example: assertThat("myStringOfNote", endsWith("Note"))
| |
| equalTo | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches when the examined object is logically equal to the specified
If the specified operand is The created matcher provides a special behaviour when examining For example:
assertThat("foo", equalTo("foo"));
assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"}));
| |
| everyItem | back to summary |
|---|---|
| public static <U> Matcher Creates a matcher for For example: assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))
| |
| hasItem | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher for For example: assertThat(Arrays.asList("foo", "bar"), hasItem("bar"))
| |
| hasItem | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher for For example: assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith("ba")))
| |
| hasItems | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher for For example: assertThat(Arrays.asList("foo", "bar", "baz"), hasItems("baz", "foo"))
| |
| hasItems | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher for For example: assertThat(Arrays.asList("foo", "bar", "baz"), hasItems(endsWith("z"), endsWith("o")))
| |
| instanceOf | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches when the examined object is an instance of the specified The created matcher assumes no relationship between specified type and the examined object. For example: assertThat(new Canoe(), instanceOf(Paddlable.class)); | |
| is | back to summary |
|---|---|
| public static <T> Matcher A shortcut to the frequently used For example: assertThat(cheese, is(smelly))instead of: assertThat(cheese, is(equalTo(smelly))) | |
| is | back to summary |
|---|---|
| public static <T> Matcher Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. For example: assertThat(cheese, is(equalTo(smelly)))instead of: assertThat(cheese, equalTo(smelly)) | |
| is | back to summary |
|---|---|
| public static <T> Matcher Deprecated use isA(Class A shortcut to the frequently used For example: assertThat(cheese, is(Cheddar.class))instead of: assertThat(cheese, is(instanceOf(Cheddar.class))) | |
| isA | back to summary |
|---|---|
| public static <T> Matcher A shortcut to the frequently used For example: assertThat(cheese, isA(Cheddar.class))instead of: assertThat(cheese, is(instanceOf(Cheddar.class))) | |
| not | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. For example: assertThat(cheese, is(not(equalTo(smelly))))
| |
| not | back to summary |
|---|---|
| public static <T> Matcher A shortcut to the frequently used For example: assertThat(cheese, is(not(smelly)))instead of: assertThat(cheese, is(not(equalTo(smelly))))
| |
| notNullValue | back to summary |
|---|---|
| public static Matcher A shortcut to the frequently used For example: assertThat(cheese, is(notNullValue()))instead of: assertThat(cheese, is(not(nullValue()))) | |
| notNullValue | back to summary |
|---|---|
| public static <T> Matcher A shortcut to the frequently used For example: assertThat(cheese, is(notNullValue(X.class)))instead of: assertThat(cheese, is(not(nullValue(X.class))))
| |
| nullValue | back to summary |
|---|---|
| public static Matcher Creates a matcher that matches if examined object is For example: assertThat(cheese, is(nullValue()) | |
| nullValue | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches if examined object is For example: assertThat(cheese, is(nullValue(Cheese.class))
| |
| sameInstance | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches only when the examined object is the same instance as the specified target object.
| |
| startsWith | back to summary |
|---|---|
| public static Matcher Creates a matcher that matches if the examined For example: assertThat("myStringOfNote", startsWith("my"))
| |
| theInstance | back to summary |
|---|---|
| public static <T> Matcher Creates a matcher that matches only when the examined object is the same instance as the specified target object.
| |