examples : assertthat caughtexception , hasmessagethat is `` index : 9 , size : 9 '' ; assertthat caughtexception , hasmessagethat containsstring `` index : 9 '' ; / / using junitmatchers assertthat caughtexception , hasmessagethat containspattern `` index : \ \ d + '' ; / / using mockito 's find concode_field_sep PlaceHolder placeHolder concode_field_sep org.hamcrest.Matcher<T> hasMessage concode_elem_sep org.hamcrest.Matcher<T> hasNoCause
org . hamcrest . Matcher < T > function ( Matcher < String > arg0 ) { return new ExceptionMessageMatcher < T > ( arg0 ) ; }