• 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.internal.verification.api;
6 
7 import org.mockito.internal.invocation.InvocationMatcher;
8 import org.mockito.invocation.Invocation;
9 import org.mockito.invocation.MatchableInvocation;
10 
11 import java.util.List;
12 
13 /**
14  * Data needed to perform verification of interactions.
15  * This interface is considered public even though it lives in private package.
16  * In the next major version of Mockito, this class will be moved to public space.
17  */
18 public interface VerificationData {
19 
20     /**
21      * All invocations recorded on the mock object that is being verified.
22      * Does not include invocations recorded on other mock objects.
23      */
getAllInvocations()24     List<Invocation> getAllInvocations();
25 
26     /**
27      * The target or wanted invocation.
28      * Below example illustrates what is the 'target' invocation:
29      * <pre class="code"><code class="java">
30      *   mock.foo();   // <- invocation 1
31      *   mock.bar();   // <- invocation 2
32      *
33      *   verify(mock).bar();  // <- target invocation
34      * </code></pre>
35      *
36      * Target invocation can contain argument matchers therefore the returned type is {@link MatchableInvocation}
37      * and not {@link Invocation}.
38      *
39      * @since 2.2.12
40      */
getTarget()41     MatchableInvocation getTarget();
42 
43     /**
44      * @deprecated - This internal method leaks internal class <code>InvocationMatcher</code>.
45      * Please use {@link org.mockito.internal.verification.api.VerificationData#getTarget()} instead.
46      *
47      * Deprecated since 2.2.12
48      */
49     @Deprecated
getWanted()50     InvocationMatcher getWanted();
51 }
52