Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JUnit test to demonstrate hamcrest assertions.
@Test
public void hamcrestAssertion() throws Exception {
String openKnowledge = "offen, kundig, gut!";
MatcherAssert.assertThat(openKnowledge, CoreMatchers.allOf(CoreMatchers.startsWith("offen"),
CoreMatchers.containsString("kundig"),
CoreMatchers.endsWith("gut!")));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment