Per release notes JUnitMatchers have been deprecated. Please use org.hamcrest.CoreMatchers directly.
@SuppressWarnings("deprecation") @Test public void test_string_contains_two_elements () { assertThat("B-double E double R U-N beer run", both(containsString("beer")) .and(containsString("run"))); }
@SuppressWarnings("deprecation") @Test public void test_string_contains () { assertThat("Meet the press", containsString("press")); }
@SuppressWarnings("deprecation") @Test public void test_string_either_or () { assertThat("the simpsons", either(containsString("the")).or(containsString("simpsons"))); }
@SuppressWarnings("deprecation") @Test public void test_every_item_contains () { List<String> movies = Lists.newArrayList( "the matrix", "the lord of the rings", "the lion king", "the dark knight"); assertThat(movies, everyItem(containsString("the"))); }
@SuppressWarnings("deprecation") @Test public void test_list_has_items () { List<String> websites = Lists.newArrayList( "leveluplunch.com", "www.leveluplunch.com" ); assertThat(websites, hasItems("leveluplunch.com")); }