Hi there,
i've just found 2 issues:
---1. for the following code example (assume it's a nominal test case, i.e. the test should pass):
@Rule
public ExpectedException expectedException = ExpectedException.none();
...
@Test
public void test() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Abc!");
...
}
the following exception is thrown:
java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V
it is caused by another NoSuchMethodError: org.hamcrest.CoreMatchers.containsString(Ljava/lang/String;)
I've checked expectMessage method, and, indeed, it has a reference to CoreMatchers.containsString which doesn't appear in mockito implementation.
The versions I use are: junit-4.11, mockito-all-1.10.8, hamcrest-core-1.3, but I've checked also with junit-4.12 and mockito-all-1.10.19, mockito-all-2.0.2-beta.
Workaround is to use
expectedException.expectMessage(equalTo("Abc!"));
---2. But! even with the 1st problem worked around, in the error case, i.e. when the test fails, it always fails with the same exception:
java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V
Could you investigate and fix this?