/** * Creates a matcher of {@link String} that matches when the examined string is <code>null</code>, or * has zero length. * For example: * <pre>assertThat(((String)null), is(emptyOrNullString()))</pre> */ public static Matcher<java.lang.String> emptyOrNullString() { return org.hamcrest.text.IsEmptyString.emptyOrNullString(); }
/** * Creates a matcher of {@link String} that matches when the examined string is <code>null</code>, or * has zero length. * For example: * <pre>assertThat(((String)null), isEmptyOrNullString())</pre> * * @deprecated use is(emptyOrNullString()) instead * */ @Deprecated public static Matcher<String> isEmptyOrNullString() { return emptyOrNullString(); }
@Test public void matchesNullAppropriately() { assertMatches(emptyOrNullString(), null); assertDoesNotMatch(emptyString(), null); }
@Test public void doesNotMatchFilledString() { assertDoesNotMatch(emptyString(), "a"); assertDoesNotMatch(emptyOrNullString(), "a"); }
@Test public void matchesEmptyString() { assertMatches(emptyOrNullString(), ""); assertMatches(emptyString(), ""); }
@Test public void describesItself() { assertDescription("an empty string", emptyString()); assertDescription("(null or an empty string)", emptyOrNullString()); }
@Test public void matchesBlankStringAppropriately() { assertDoesNotMatch(emptyString(), " "); assertDoesNotMatch(emptyOrNullString(), " "); }
@Test public void describesAMismatch() { assertMismatchDescription("was \"a\"", emptyString(), "a"); assertMismatchDescription("was \"a\"", emptyOrNullString(), "a"); } }
/** * Creates a matcher of {@link String} that matches when the examined string is <code>null</code>, or * has zero length. * For example: * <pre>assertThat(((String)null), is(emptyOrNullString()))</pre> */ public static org.hamcrest.Matcher<java.lang.String> emptyOrNullString() { return org.hamcrest.text.IsEmptyString.emptyOrNullString(); }
/** * Creates a matcher of {@link String} that matches when the examined string is <code>null</code>, or * has zero length. * For example: * <pre>assertThat(((String)null), isEmptyOrNullString())</pre> * * @deprecated use is(emptyOrNullString()) instead * */ @Deprecated public static Matcher<String> isEmptyOrNullString() { return emptyOrNullString(); }
/** * Creates a matcher of {@link String} that matches when the examined string is <code>null</code>, or * has zero length. * For example: * <pre>assertThat(((String)null), is(emptyOrNullString()))</pre> */ public static Matcher<java.lang.String> emptyOrNullString() { return org.hamcrest.text.IsEmptyString.emptyOrNullString(); }
/** * Creates a matcher of {@link String} that matches when the examined string is <code>null</code>, or * has zero length. * For example: * <pre>assertThat(((String)null), isEmptyOrNullString())</pre> * * @deprecated use is(emptyOrNullString()) instead * */ @Deprecated public static Matcher<String> isEmptyOrNullString() { return emptyOrNullString(); }