Class StringAsserts


  • public class StringAsserts
    extends Object
    More complex asserts for strings
    • Constructor Detail

      • StringAsserts

        public StringAsserts()
    • 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 failure
        toFind - 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 failure
        toCheck - The string to look in
        contents - 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 failure
        toFind - The string to find
        toCheck - The string to look in
      • assertStringNotContains

        public static void assertStringNotContains​(String msg,
                                                   String toFind,
                                                   String toCheck)
        Assert that one string doesn not contain another.
        Parameters:
        msg - the error message to show in case of failure
        toFind - The string to find.
        toCheck - The string to look in