• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2007 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 
6 package org.mockito.invocation;
7 
8 import java.io.Serializable;
9 import java.lang.reflect.Method;
10 
11 /**
12  * An invocation on a mock
13  * <p>
14  * A placeholder for mock, the method that was called and the arguments that were passed.
15  */
16 public interface InvocationOnMock extends Serializable {
17 
18     /**
19      * returns the mock object
20      *
21      * @return mock object
22      */
getMock()23     Object getMock();
24 
25     /**
26      * returns the method
27      *
28      * @return method
29      */
getMethod()30     Method getMethod();
31 
32     /**
33      * returns arguments passed to the method
34      *
35      * @return arguments
36      */
getArguments()37     Object[] getArguments();
38 
39     /**
40      * calls real method
41      * <p>
42      * <b>Warning:</b> depending on the real implementation it might throw exceptions
43      *
44      * @return whatever the real method returns / throws
45      * @throws Throwable in case real method throws
46      */
callRealMethod()47     Object callRealMethod() throws Throwable;
48 }
49