Lines Matching refs:answer
249 * This is because of improved readability and consistency with the family of {@link Mockito#doAnswer(Answer)} methods.
418 * Allows stubbing with generic {@link Answer} interface.
426 * when(mock.someMethod(anyString())).thenAnswer(new Answer() {
427 * Object answer(InvocationOnMock invocation) {
477 * {@link Mockito#doAnswer(Answer)}
528 * Therefore when using spies please consider <code>doReturn</code>|<code>Answer</code>|<code>Throw()</code> family of
565 * It is the default answer so it will be used <b>only when you don't</b> stub the method call.
573 * Read more about this interesting implementation of <i>Answer</i>: {@link Mockito#RETURNS_SMART_NULLS}
935 * The default <code>Answer</code> of every mock <b>if</b> the mock was not stubbed.
938 * {@link Answer} can be used to define the return values of unstubbed invocations.
943 public static final Answer<Object> RETURNS_DEFAULTS = Answers.RETURNS_DEFAULTS.get();
946 * Optional <code>Answer</code> to be used with {@link Mockito#mock(Class, Answer)}.
948 * {@link Answer} can be used to define the return values of unstubbed invocations.
952 * This implementation of Answer <b>returns SmartNull instead of null</b>.
975 public static final Answer<Object> RETURNS_SMART_NULLS = Answers.RETURNS_SMART_NULLS.get();
978 * Optional <code>Answer</code> to be used with {@link Mockito#mock(Class, Answer)}
980 * {@link Answer} can be used to define the return values of unstubbed invocations.
988 public static final Answer<Object> RETURNS_MOCKS = Answers.RETURNS_MOCKS.get();
991 * Optional <code>Answer</code> to be used with {@link Mockito#mock(Class, Answer)}.
1017 * Please note that this answer will return existing mocks that matches the stub. This
1075 public static final Answer<Object> RETURNS_DEEP_STUBS = Answers.RETURNS_DEEP_STUBS.get();
1078 * Optional <code>Answer</code> to be used with {@link Mockito#mock(Class, Answer)}
1080 * {@link Answer} can be used to define the return values of unstubbed invocations.
1109 public static final Answer<Object> CALLS_REAL_METHODS = Answers.CALLS_REAL_METHODS.get();
1164 * See {@link Mockito#mock(Class, Answer)}
1166 * Why it is deprecated? ReturnValues is being replaced by Answer
1168 * Answer interface has been in Mockito for a while and it has the same responsibility as ReturnValues.
1201 * It is the default answer so it will be used <b>only when you don't</b> stub the method call.
1211 * @param defaultAnswer default answer for unstubbed methods
1215 public static <T> T mock(Class<T> classToMock, Answer defaultAnswer) {
1288 * Therefore for spies it is recommended to always use <code>doReturn</code>|<code>Answer</code>|<code>Throw()</code>|<code>CallRealMethod</code>
1710 * Use <code>doAnswer()</code> when you want to stub a void method with generic {@link Answer}.
1717 * doAnswer(new Answer() {
1718 * public Object answer(InvocationOnMock invocation) {
1728 * @param answer to answer when the stubbed method is called
1731 public static Stubber doAnswer(Answer answer) {
1732 return MOCKITO_CORE.doAnswer(answer);
2140 * //Creates mock with different default answer & name
2145 * //Creates mock with different default answer, descriptive name and extra interfaces