public final class StringAssert
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
StringAssert() |
Modifier and Type | Method and Description |
---|---|
static void |
assertContains(java.lang.String msg,
java.lang.String haystack,
java.lang.String needle)
Asserts that string (
haystack ) contains specified text (
needle ). |
static void |
assertContains(java.lang.String msg,
java.lang.String haystack,
java.lang.String needle,
int offset)
Asserts that string (
haystack ) contains specified text (
needle ), starting at offset (in haystack ). |
static void |
assertContainsSame(java.lang.String msg,
java.util.List<java.lang.String> linesExpected,
java.util.List<java.lang.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(java.lang.String msg,
java.lang.String haystack,
java.lang.String needle)
Asserts that string (
haystack ) does not contain
specified text (needle ). |
static void |
assertNotContains(java.lang.String msg,
java.lang.String haystack,
java.lang.String needle,
int offset)
Asserts that string (
haystack ) does not contain
specified text (needle ), starting at offset (in
haystack ). |
static void |
assertStartsWith(java.lang.String msg,
java.lang.String haystack,
java.lang.String expected)
Asserts that the string (
haystack ) starts with the string (
expected ) |
public static void assertContains(java.lang.String msg, java.lang.String haystack, java.lang.String needle)
haystack
) contains specified text (
needle
).msg
- the assertion messagehaystack
- the text to search inneedle
- the text to search forpublic static void assertContains(java.lang.String msg, java.lang.String haystack, java.lang.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(java.lang.String msg, java.util.List<java.lang.String> linesExpected, java.util.List<java.lang.String> linesActual)
msg
- the assertion messagelinesExpected
- the list of expected lineslinesActual
- the list of actual linespublic static void assertNotContains(java.lang.String msg, java.lang.String haystack, java.lang.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(java.lang.String msg, java.lang.String haystack, java.lang.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 frompublic static void assertStartsWith(java.lang.String msg, java.lang.String haystack, java.lang.String expected)
haystack
) starts with the string (
expected
)msg
- the assertion messagehaystack
- the text to search inexpected
- the expected starts with text