package org.hamcrest.examples.testng; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import org.testng.annotations.Test; /** * Demonstrates how Hamcrest matchers can be used with assertThat() * using TestNG. * * @author Joe Walnes */ @Test public class ExampleWithAssertThat { @Test public void usingAssertThat() { assertThat("xx", is("xx")); assertThat("yy", is(not("xx"))); assertThat("i like cheese", containsString("cheese")); } }