Skip to content

Commit

Permalink
fixed files form Mockito #9
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 0e8c9f0 commit e4b0162
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
package org.mockito.internal.stubbing.answers;

import java.io.Serializable;
import java.lang.reflect.Modifier;

import org.mockito.internal.stubbing.defaultanswers.GloballyConfiguredAnswer;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

Expand Down Expand Up @@ -33,6 +35,9 @@ public class CallsRealMethods implements Answer<Object>, Serializable {
private static final long serialVersionUID = 9057165148930624087L;

public Object answer(InvocationOnMock invocation) throws Throwable {
if (Modifier.isAbstract(invocation.getMethod().getModifiers())) {
return new GloballyConfiguredAnswer().answer(invocation);
}
return invocation.callRealMethod();
}
}

0 comments on commit e4b0162

Please sign in to comment.