/external/mockito/src/org/mockito/ |
AdditionalAnswers.java | 10 import org.mockito.stubbing.Answer; 34 * This additional answer could be used at stub time using the 35 * <code>then|do|will{@link org.mockito.stubbing.Answer}</code> methods. For example : 42 * @return Answer that will return the first argument of the invocation. 46 public static <T> Answer<T> returnsFirstArg() { 47 return (Answer<T>) RETURNS_FIRST_ARGUMENT; 54 * This additional answer could be used at stub time using the 55 * <code>then|do|will{@link org.mockito.stubbing.Answer}</code> methods. For example : 62 * @return Answer that will return the second argument of the invocation. 66 public static <T> Answer<T> returnsSecondArg() [all...] |
Answers.java | 12 import org.mockito.stubbing.Answer;
21 * @Mock(answer = RETURNS_DEEP_STUBS) UserProvider userProvider;
28 * The default configured answer of every mock.
37 * An answer that returns smart-nulls.
46 * An answer that returns <strong>mocks</strong> (not stubs).
56 * An answer that returns <strong>deep stubs</strong> (not mocks).
65 * An answer that calls the real methods (used for partial mocks).
74 private Answer<Object> implementation;
76 private Answers(Answer<Object> implementation) {
80 public Answer<Object> get() { [all...] |
ReturnValues.java | 9 import org.mockito.stubbing.Answer; 13 * <b>Instead, please use {@link Answer} interface</b> 18 * Why it is deprecated? ReturnValues is being replaced by Answer 20 * Answer interface has been in Mockito for a while and it has the same responsibility as ReturnValues.
|
MockSettings.java | 9 import org.mockito.stubbing.Answer; 23 * //Creates mock with different default answer & name 29 * //Creates mock with different default answer, descriptive name and extra interfaces 107 * <code>doReturn</code>|<code>Throw</code>|<code>Answer</code>|<code>CallRealMethod</code> stubbing style. Example: 130 * It is the default answer so it will be used <b>only when you don't</b> stub the method call. 140 * @param defaultAnswer default answer to be used by mock when not stubbed 144 MockSettings defaultAnswer(Answer defaultAnswer);
|
/external/mockito/src/org/mockito/internal/stubbing/ |
ConsecutiveStubbing.java | 7 import org.mockito.stubbing.Answer;
18 public OngoingStubbing<T> thenAnswer(Answer<?> answer) {
19 invocationContainerImpl.addConsecutiveAnswer(answer);
23 public OngoingStubbing<T> then(Answer<?> answer) {
24 return thenAnswer(answer);
27 public DeprecatedOngoingStubbing<T> toAnswer(Answer<?> answer) {
28 invocationContainerImpl.addConsecutiveAnswer(answer);
[all...] |
StubbedInvocationMatcher.java | 14 import org.mockito.stubbing.Answer;
17 public class StubbedInvocationMatcher extends InvocationMatcher implements Answer, Serializable {
20 private final Queue<Answer> answers = new ConcurrentLinkedQueue<Answer>();
23 public StubbedInvocationMatcher(InvocationMatcher invocation, Answer answer) {
25 this.answers.add(answer);
28 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:StubbedInvocationMatcher 30 Answer a;
34 return a.answer(invocation); [all...] |
OngoingStubbingImpl.java | 9 import org.mockito.stubbing.Answer;
23 public OngoingStubbing<T> thenAnswer(Answer<?> answer) {
28 invocationContainerImpl.addAnswer(answer);
32 public OngoingStubbing<T> then(Answer<?> answer) {
33 return thenAnswer(answer);
36 public DeprecatedOngoingStubbing<T> toAnswer(Answer<?> answer) {
37 invocationContainerImpl.addAnswer(answer);
[all...] |
StubberImpl.java | 10 import org.mockito.stubbing.Answer;
19 final List<Answer> answers = new LinkedList<Answer>();
57 public Stubber doAnswer(Answer answer) {
58 answers.add(answer);
|
/external/mockito/src/org/mockito/internal/stubbing/defaultanswers/ |
Answers.java | 9 import org.mockito.stubbing.Answer;
30 private Answer<Object> implementation;
32 private Answers(Answer<Object> implementation) {
36 public Answer<Object> get() {
|
GloballyConfiguredAnswer.java | 12 import org.mockito.stubbing.Answer;
15 * Globally configured Answer.
19 public class GloballyConfiguredAnswer implements Answer<Object>, Serializable {
23 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:GloballyConfiguredAnswer 24 return new GlobalConfiguration().getDefaultAnswer().answer(invocation);
|
ReturnsMocks.java | 12 import org.mockito.stubbing.Answer;
14 public class ReturnsMocks implements Answer<Object>, Serializable {
18 private Answer<Object> delegate = new ReturnsMoreEmptyValues();
20 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:ReturnsMocks 21 Object ret = delegate.answer(invocation);
|
ReturnsMoreEmptyValues.java | 13 import org.mockito.stubbing.Answer; 48 public class ReturnsMoreEmptyValues implements Answer<Object>, Serializable { 51 private Answer<Object> delegate = new ReturnsEmptyValues(); 54 * @see org.mockito.stubbing.Answer#answer(org.mockito.invocation.InvocationOnMock) 56 public Object answer(InvocationOnMock invocation) throws Throwable { method in class:ReturnsMoreEmptyValues 57 Object ret = delegate.answer(invocation);
|
ForwardsInvocations.java | 8 import org.mockito.stubbing.Answer; 14 * Internal answer to forward invocations on a real instance. 18 public class ForwardsInvocations implements Answer<Object>, Serializable { 28 public Object answer(InvocationOnMock invocation) throws Throwable { method in class:ForwardsInvocations
|
ReturnsSmartNulls.java | 16 import org.mockito.stubbing.Answer;
19 * Optional Answer that can be used with
20 * {@link Mockito#mock(Class, Answer)}
25 * Answer returns SmartNulls instead of nulls.
36 public class ReturnsSmartNulls implements Answer<Object>, Serializable {
40 private final Answer<Object> delegate = new ReturnsMoreEmptyValues();
42 public Object answer(final InvocationOnMock invocation) throws Throwable {
method in class:ReturnsSmartNulls 43 Object defaultReturnValue = delegate.answer(invocation);
55 private static class ThrowsSmartNullPointer implements Answer {
64 public Object answer(InvocationOnMock currentInvocation) throws Throwable { method in class:ReturnsSmartNulls.ThrowsSmartNullPointer [all...] |
/external/mockito/src/org/mockito/stubbing/ |
Answer.java | 10 * Generic interface to be used for configuring mock's answer.
11 * Answer specifies an action that is executed and a return value that is returned when you interact with the mock.
13 * Example of stubbing a mock with custom answer:
16 * when(mock.someMethod(anyString())).thenAnswer(new Answer() {
17 * Object answer(InvocationOnMock invocation) {
30 public interface Answer<T> {
38 T answer(InvocationOnMock invocation) throws Throwable;
method in interface:Answer
|
OngoingStubbing.java | 148 * Sets a generic Answer for the method. E.g:
150 * when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() {
151 * public Integer answer(InvocationOnMock invocation) throws Throwable {
157 * @param answer the custom answer to execute.
161 OngoingStubbing<T> thenAnswer(Answer<?> answer);
164 * Sets a generic Answer for the method.
166 * This method is an alias of {@link #thenAnswer(Answer)}. This alias allows
176 * @param answer the custom answer to execute. [all...] |
/external/mockito/src/org/mockito/configuration/ |
IMockitoConfiguration.java | 9 import org.mockito.stubbing.Answer;
59 Answer<Object> getDefaultAnswer();
|
DefaultMockitoConfiguration.java | 10 import org.mockito.stubbing.Answer;
31 public Answer<Object> getDefaultAnswer() {
|
/external/mockito/src/org/mockito/internal/stubbing/answers/ |
CallsRealMethods.java | 10 import org.mockito.stubbing.Answer;
13 * Optional Answer that adds partial mocking support
15 * {@link Answer} can be used to define the return values of unstubbed invocations.
32 public class CallsRealMethods implements Answer<Object>, Serializable {
35 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:CallsRealMethods
|
DoesNothing.java | 10 import org.mockito.stubbing.Answer;
12 public class DoesNothing implements Answer<Object>, Serializable {
16 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:DoesNothing
|
AnswerReturnValuesAdapter.java | 11 import org.mockito.stubbing.Answer;
15 public class AnswerReturnValuesAdapter implements Answer<Object>, Serializable {
24 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:AnswerReturnValuesAdapter
|
Returns.java | 10 import org.mockito.stubbing.Answer;
12 public class Returns implements Answer<Object>, Serializable {
21 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:Returns
|
ReturnsElementsOf.java | 9 import org.mockito.stubbing.Answer;
33 public class ReturnsElementsOf implements Answer<Object> {
45 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:ReturnsElementsOf
|
/external/mockito/src/org/mockito/mock/ |
MockCreationSettings.java | 10 import org.mockito.stubbing.Answer; 37 * the default answer for this mock, see {@link org.mockito.MockSettings#defaultAnswer}. 39 Answer getDefaultAnswer();
|
/external/mockito/src/org/mockito/internal/ |
InternalMockHandler.java | 12 import org.mockito.stubbing.Answer;
22 void setAnswersForStubbing(List<Answer> answers);
|