Skip to content

Instantly share code, notes, and snippets.

@r-winkler
Last active April 16, 2016 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-winkler/fab2c1fc0103baa4e3e70b0f8165011b to your computer and use it in GitHub Desktop.
Save r-winkler/fab2c1fc0103baa4e3e70b0f8165011b to your computer and use it in GitHub Desktop.
public class HamcrestStringAssert {
private static final String DEV = "Developer";
@Test
public void testString() {
assertThat(DEV, is(notNullValue()));
assertThat(DEV, not(isEmptyString()));
assertThat(DEV, startsWith("Dev"));
assertThat(DEV.length(), equalTo(9));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment