public static <T> void assertMismatchDescription( String expected, Matcher<? super T> matcher, T arg) { assertFalse("Precondtion: Matcher should not match item.", matcher.matches(arg)); Description description = new StringDescription(); matcher.describeMismatch(arg, description); assertEquals("Expected mismatch description", expected, description.toString().trim()); }
private void assertMismatchDescription(String expectedDescription, Object actual) { StringDescription description = new StringDescription(); matcher.describeMismatch(actual, description); assertEquals(expectedDescription, description.toString()); }