/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", is(emptyString()))</pre> */ public static Matcher<java.lang.String> emptyString() { return org.hamcrest.text.IsEmptyString.emptyString(); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", isEmptyString())</pre> * * @deprecated use is(emptyString()) instead */ @Deprecated public static Matcher<String> isEmptyString() { return emptyString(); }
@Test public void copesWithNullsAndUnknownTypes() { Matcher<String> matcher = emptyString(); assertNullSafe(matcher); assertUnknownTypeSafe(matcher); }
@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 has zero length. * For example: * <pre>assertThat("", is(emptyString()))</pre> */ public static org.hamcrest.Matcher<java.lang.String> emptyString() { return org.hamcrest.text.IsEmptyString.emptyString(); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", isEmptyString())</pre> * * @deprecated use is(emptyString()) instead */ @Deprecated public static Matcher<String> isEmptyString() { return emptyString(); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", is(emptyString()))</pre> */ public static Matcher<java.lang.String> emptyString() { return org.hamcrest.text.IsEmptyString.emptyString(); }
/** * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: * <pre>assertThat("", isEmptyString())</pre> * * @deprecated use is(emptyString()) instead */ @Deprecated public static Matcher<String> isEmptyString() { return emptyString(); }