/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * <p/> * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}, ignoring case. * For example: * <pre>assertThat("myStringOfNote", endsWithIgnoringCase("note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static Matcher<String> endsWithIgnoringCase(String suffix) { return new StringEndsWith(true, suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}, ignoring case. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWithIgnoringCase(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWithIgnoringCase(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * <p/> * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static Matcher<String> endsWith(String suffix) { return new StringEndsWith(false, suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}, ignoring case. * For example: * <pre>assertThat("myStringOfNote", endsWithIgnoringCase("note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static Matcher<java.lang.String> endsWithIgnoringCase(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWithIgnoringCase(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * <p/> * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * <p/> * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ @Factory public static Matcher<String> endsWith(String suffix) { return new StringEndsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}, ignoring case. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWithIgnoringCase(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWithIgnoringCase(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static Matcher<java.lang.String> endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * <p/> * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ @Factory public static Matcher<String> endsWith(String suffix) { return new StringEndsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}, ignoring case. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWithIgnoringCase(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWithIgnoringCase(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static org.hamcrest.Matcher<java.lang.String> endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); }
/** * Creates a matcher that matches if the examined {@link String} ends with the specified * {@link String}, ignoring case. * For example: * <pre>assertThat("myStringOfNote", endsWith("Note"))</pre> * * @param suffix * the substring that the returned matcher will expect at the end of any examined string */ public static Matcher<String> endsWithIgnoringCase(String suffix) { return new StringEndsWith(true, suffix); }
public void testMatchesSubstringAtEndIngoringCase() { final Matcher<String> ignoringCase = endsWithIgnoringCase("EXCERpt"); assertDoesNotMatch(ignoringCase, "eXCErpt" + "END"); assertMatches(ignoringCase, "START" + "EXceRpt"); assertMatches(ignoringCase, "EXcerPT"); assertDoesNotMatch(ignoringCase, "START" + "ExcERpt" + "END"); assertMatches(ignoringCase, "exCERpt" + "EXCerPt"); assertDoesNotMatch(ignoringCase, "ExcER"); assertMismatchDescription("was \"Something else\"", ignoringCase, "Something else"); assertDescription("a string ending with \"EXCERpt\" ignoring case", ignoringCase); }
@Test public void endWithFailsWithNullSubstring() { thrown.expect(IllegalArgumentException.class); endsWith(null); }
private static ResultMatcher invalidTokenHeader(String message) { return header().string(HttpHeaders.WWW_AUTHENTICATE, AllOf.allOf( new StringStartsWith("Bearer " + "error=\"invalid_token\", " + "error_description=\""), new StringContains(message), new StringEndsWith(", " + "error_uri=\"https://tools.ietf.org/html/rfc6750#section-3.1\"") ) ); }