Class StringEndsWith

  • All Implemented Interfaces:
    Matcher<java.lang.String>, SelfDescribing

    public class StringEndsWith
    extends SubstringMatcher
    Tests if the argument is a string that contains a substring.
    • Constructor Detail

      • StringEndsWith

        public StringEndsWith​(java.lang.String substring)
    • Method Detail

      • endsWith

        public static Matcher<java.lang.String> endsWith​(java.lang.String suffix)
        Creates a matcher that matches if the examined String ends with the specified String.

        For example:

        assertThat("myStringOfNote", endsWith("Note"))
        Parameters:
        suffix - the substring that the returned matcher will expect at the end of any examined string