public class StringContains extends SubstringMatcher
substring| Constructor and Description |
|---|
StringContains(String substring) |
| Modifier and Type | Method and Description |
|---|---|
static Matcher<String> |
containsString(String substring)
|
protected boolean |
evalSubstringOf(String s) |
protected String |
relationship() |
describeMismatchSafely, describeTo, matchesSafelydescribeMismatch, matches_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringpublic StringContains(String substring)
protected boolean evalSubstringOf(String s)
evalSubstringOf in class SubstringMatcherprotected String relationship()
relationship in class SubstringMatcherpublic static Matcher<String> containsString(String substring)
String contains the specified
String anywhere.
For example:
assertThat("myStringOfNote", containsString("ring"))substring - the substring that the returned matcher will expect to find within any examined stringCopyright © 2002–2017 JUnit. All rights reserved.