public final class StringAssert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertContains(String msg,
String haystack,
String needle)
Asserts that string (
haystack ) contains specified text (
needle ). |
static void |
assertContains(String msg,
String haystack,
String needle,
int offset)
Asserts that string (
haystack ) contains specified text (
needle ), starting at offset (in haystack ). |
static void |
assertContainsSame(String msg,
List<String> linesExpected,
List<String> linesActual)
Asserts that the list of String lines contains the same lines (without a regard for the order of those lines)
|
static void |
assertNotContains(String msg,
String haystack,
String needle)
Asserts that string (
haystack ) does not contain
specified text (needle ). |
static void |
assertNotContains(String msg,
String haystack,
String needle,
int offset)
Asserts that string (
haystack ) does not contain
specified text (needle ), starting at offset (in
haystack ). |
static void |
assertStartsWith(String msg,
String haystack,
String expected)
Asserts that the string (
haystack ) starts with the string (
expected ) |
public static void assertContains(String msg, String haystack, String needle)
haystack
) contains specified text (
needle
).msg
- the assertion messagehaystack
- the text to search inneedle
- the text to search forpublic static void assertContains(String msg, String haystack, String needle, int offset)
haystack
) contains specified text (
needle
), starting at offset (in haystack
).msg
- the assertion messagehaystack
- the text to search inneedle
- the text to search foroffset
- the offset in (haystack) to perform search frompublic static void assertContainsSame(String msg, List<String> linesExpected, List<String> linesActual)
msg
- the assertion messagelinesExpected
- the list of expected lineslinesActual
- the list of actual linespublic static void assertNotContains(String msg, String haystack, String needle)
haystack
) does not contain
specified text (needle
).msg
- the assertion messagehaystack
- the text to search inneedle
- the text to search forpublic static void assertNotContains(String msg, String haystack, String needle, int offset)
haystack
) does not contain
specified text (needle
), starting at offset (in
haystack
).msg
- the assertion messagehaystack
- the text to search inneedle
- the text to search foroffset
- the offset in (haystack) to perform search fromCopyright © 1995–2019 Mort Bay Consulting. All rights reserved.