MockCreationSettings.java revision e0ae5d7e87b1dd6e789803c1b9615a84bd7488b7
1/*
2 * Copyright (c) 2007 Mockito contributors
3 * This program is made available under the terms of the MIT License.
4 */
5
6package org.mockito.mock;
7
8import org.mockito.Incubating;
9import org.mockito.listeners.InvocationListener;
10import org.mockito.stubbing.Answer;
11
12import java.util.List;
13import java.util.Set;
14
15/**
16 * Informs about the mock settings. An immutable view of {@link org.mockito.MockSettings}.
17 */
18@Incubating
19public interface MockCreationSettings<T> {
20
21    /**
22     * Mocked type. An interface or class the mock should implement / extend.
23     */
24    Class<T> getTypeToMock();
25
26    /**
27     * the extra interfaces the mock object should implement.
28     */
29    Set<Class> getExtraInterfaces();
30
31    /**
32     * the name of this mock, as printed on verification errors; see {@link org.mockito.MockSettings#name}.
33     */
34    MockName getMockName();
35
36    /**
37     * the default answer for this mock, see {@link org.mockito.MockSettings#defaultAnswer}.
38     */
39    Answer getDefaultAnswer();
40
41    /**
42     * the spied instance - needed for spies.
43     */
44    Object getSpiedInstance();
45
46    /**
47     * if the mock is serializable, see {@link org.mockito.MockSettings#serializable}.
48     */
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     */
56    boolean isStubOnly();
57
58    /**
59     * the invocation listeners attached to this mock, see {@link org.mockito.MockSettings#invocationListeners}.
60     */
61    List<InvocationListener> getInvocationListeners();
62}