• 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 package org.mockito.listeners;
6 
7 import org.mockito.invocation.DescribedInvocation;
8 
9 /**
10  * Represent a method call on a mock.
11  *
12  * <p>
13  *     Contains the information on the mock, the location of the stub
14  *     the return value if it returned something (maybe null), or an
15  *     exception if one was thrown when the method was invoked.
16  * </p>
17  */
18 public interface MethodInvocationReport {
19     /**
20      * @return Information on the method call, never {@code null}
21      */
getInvocation()22     DescribedInvocation getInvocation();
23 
24     /**
25      * @return The resulting value of the method invocation, may be <code>null</code>
26      */
getReturnedValue()27     Object getReturnedValue();
28 
29     /**
30      * @return The throwable raised by the method invocation, maybe <code>null</code>
31      */
getThrowable()32     Throwable getThrowable();
33 
34     /**
35      * @return <code>true</code> if an exception was raised, <code>false</code> otherwise
36      */
threwException()37     boolean threwException();
38 
39     /**
40      * @return Location of the stub invocation
41      */
getLocationOfStubbing()42     String getLocationOfStubbing();
43 }
44