Skip to content

Commit

Permalink
fixed files form Mockito #4
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent de09516 commit 51ba3d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions projects/Mockito/4/org/mockito/exceptions/Reporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public void noMoreInteractionsWanted(Invocation undesired, List<VerificationAwar
throw new NoInteractionsWanted(join(
"No interactions wanted here:",
new LocationImpl(),
"But found this interaction on mock '" + undesired.getMock() + "':",
"But found this interaction on mock '" + safelyGetMockName(undesired.getMock()) + "':",
undesired.getLocation(),
scenario
));
Expand All @@ -431,7 +431,7 @@ public void noMoreInteractionsWantedInOrder(Invocation undesired) {
throw new VerificationInOrderFailure(join(
"No interactions wanted here:",
new LocationImpl(),
"But found this interaction on mock '" + undesired.getMock() + "':",
"But found this interaction on mock '" + safelyGetMockName(undesired.getMock()) + "':",
undesired.getLocation()
));
}
Expand Down Expand Up @@ -674,6 +674,9 @@ public void cannotInjectDependency(Field field, Object matchingMock, Exception d
}

private String exceptionCauseMessageIfAvailable(Exception details) {
if (details.getCause() == null) {
return details.getMessage();
}
return details.getCause().getMessage();
}

Expand Down

0 comments on commit 51ba3d3

Please sign in to comment.