Class AssertRegex


  • public final class AssertRegex
    extends Object
    Utility methods related to JUNIT and java.util.regex.
    • Method Detail

      • assertMatches

        public static void assertMatches​(String expectedRegex,
                                         String actual)
        Fails unless the actual string matches the given expectedRegex.
      • assertMatches

        public static void assertMatches​(@Nullable
                                         String message,
                                         String expectedRegex,
                                         String actual)
        Fails with the given message unless the actual string matches the given expectedRegex.
      • assertMatches

        public static void assertMatches​(List<String> actuals,
                                         String... expectedRegexes)
        Fails unless each of the actuals matches the respective regex.
      • assertMatches

        public static void assertMatches​(String message,
                                         List<String> actuals,
                                         String... expectedRegexes)
        Fails unless each of the actuals matches the respective regex.
      • assertMatches

        public static void assertMatches​(List<String> expectedRegexes,
                                         List<String> actuals)
        Fails unless each of the actuals matches the respective regex.
      • assertMatches

        public static void assertMatches​(@Nullable
                                         String message,
                                         List<String> expectedRegexes,
                                         List<String> actuals)
        Fails with the given message unless each of the actuals matches the respective regex.
      • assertFind

        public static void assertFind​(String expectedRegex,
                                      String actual)
        Fails unless the expectedRegex can be found at least once in the actual string.
      • assertFind

        public static void assertFind​(@Nullable
                                      String message,
                                      String expectedRegex,
                                      String actual)
        Fails with the given message unless the expectedRegex can be found at least once in the actual string.