Class RegExAssert


  • public final class RegExAssert
    extends Object
    Assertions based on regular expression matching.
    Since:
    0.5.0
    Version:
    $Id$
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • RegExAssert

        private RegExAssert()
        Constructor. It is private so that no instances can be created.
    • Method Detail

      • assertMatches

        public static void assertMatches​(String message,
                                         String pattern,
                                         String string)
        Asserts that the given string matches the given pattern. This assertion holds if both pattern and string are null. If the assertion does not hold, the AssertionError thrown starts with the given message, which may be null if no such custom message prefix is desired.
        Parameters:
        message - The message.
        pattern - The pattern.
        string - The string.
      • assertMatches

        public static void assertMatches​(String pattern,
                                         String string)
        Asserts that the given string matches the given pattern. This assertion holds if both pattern and string are null.
        Parameters:
        pattern - The pattern.
        string - The string.