use of org.mockito.exceptions.verification.junit.ArgumentsAreDifferent in project mockito by mockito.
the class VerificationOverTimeImplTest method should_deal_with_junit_assertion_error.
@Test
public void should_deal_with_junit_assertion_error() {
ArgumentsAreDifferent toBeThrown = new ArgumentsAreDifferent("message", "wanted", "actual");
exception.expect(is(toBeThrown));
exception.expectMessage("message");
doThrow(toBeThrown).when(delegate).verify(null);
impl.verify(null);
}
use of org.mockito.exceptions.verification.junit.ArgumentsAreDifferent in project mockito by mockito.
the class PrintingVerboseTypesWithArgumentsTest method should_not_show_types_when_types_are_the_same_even_if_to_string_gives_the_same_result.
@Test
public void should_not_show_types_when_types_are_the_same_even_if_to_string_gives_the_same_result() {
//given
IMethods mock = mock(IMethods.class);
mock.simpleMethod(new Foo(10));
try {
//when
verify(mock).simpleMethod(new Foo(20));
fail();
} catch (ArgumentsAreDifferent e) {
//then
assertThat(e).hasMessageContaining("simpleMethod(foo)");
}
}
Aggregations