• 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.mock;
7 
8 import org.mockito.Incubating;
9 import org.mockito.listeners.InvocationListener;
10 import org.mockito.stubbing.Answer;
11 
12 import java.util.List;
13 import java.util.Set;
14 
15 /**
16  * Informs about the mock settings. An immutable view of {@link org.mockito.MockSettings}.
17  */
18 @Incubating
19 public interface MockCreationSettings<T> {
20 
21     /**
22      * Mocked type. An interface or class the mock should implement / extend.
23      */
getTypeToMock()24     Class<T> getTypeToMock();
25 
26     /**
27      * the extra interfaces the mock object should implement.
28      */
getExtraInterfaces()29     Set<Class> getExtraInterfaces();
30 
31     /**
32      * the name of this mock, as printed on verification errors; see {@link org.mockito.MockSettings#name}.
33      */
getMockName()34     MockName getMockName();
35 
36     /**
37      * the default answer for this mock, see {@link org.mockito.MockSettings#defaultAnswer}.
38      */
getDefaultAnswer()39     Answer getDefaultAnswer();
40 
41     /**
42      * the spied instance - needed for spies.
43      */
getSpiedInstance()44     Object getSpiedInstance();
45 
46     /**
47      * if the mock is serializable, see {@link org.mockito.MockSettings#serializable}.
48      */
isSerializable()49     boolean isSerializable();
50 
51     /**
52      * Whether the mock is only for stubbing, i.e. does not remember
53      * parameters on its invocation and therefore cannot
54      * be used for verification
55      */
isStubOnly()56     boolean isStubOnly();
57 
58     /**
59      * the invocation listeners attached to this mock, see {@link org.mockito.MockSettings#invocationListeners}.
60      */
getInvocationListeners()61     List<InvocationListener> getInvocationListeners();
62 }