Skip to content

Commit

Permalink
fixed files form Mockito #37
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 35ad96c commit 8f1bb4e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ public void validate(Answer<?> answer, Invocation invocation) {
validateDoNothing((DoesNothing) answer, invocation);
}

if (answer instanceof CallsRealMethods) {
validateMockingConcreteClass((CallsRealMethods) answer, invocation);
}
}

private void validateMockingConcreteClass(CallsRealMethods answer, Invocation invocation) {
if (invocation.getMethod().getDeclaringClass().isInterface()) {
reporter.cannotCallRealMethodOnInterface();
}
}

private void validateDoNothing(DoesNothing answer, Invocation invocation) {
if (!invocation.isVoid()) {
Expand Down

0 comments on commit 8f1bb4e

Please sign in to comment.