Package dk.netarkivet.testutils
Class StringAsserts
- java.lang.Object
-
- dk.netarkivet.testutils.StringAsserts
-
public class StringAsserts extends Object
More complex asserts for strings
-
-
Constructor Summary
Constructors Constructor Description StringAsserts()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
assertStringContains(String msg, String toFind, String toCheck)
Assert that one string contains another.static void
assertStringContains(String msg, String toCheck, String... contents)
Asserts that one string contains a set of substringsstatic void
assertStringMatches(String msg, String toFind, String toCheck)
Assert that a string matches a regular expression.static void
assertStringNotContains(String msg, String toFind, String toCheck)
Assert that one string doesn not contain another.
-
-
-
Method Detail
-
assertStringContains
public static void assertStringContains(String msg, String toFind, String toCheck)
Assert that one string contains another.- Parameters:
msg
- the error message to show in case of failuretoFind
- The string to find.toCheck
- The string to look in
-
assertStringContains
public static void assertStringContains(String msg, String toCheck, String... contents)
Asserts that one string contains a set of substrings- Parameters:
msg
- the error message to show in case of failuretoCheck
- The string to look incontents
- the strings to look for
-
assertStringMatches
public static void assertStringMatches(String msg, String toFind, String toCheck)
Assert that a string matches a regular expression.- Parameters:
msg
- the error message to show in case of failuretoFind
- The string to findtoCheck
- The string to look in
-
-