/external/mockito/src/org/mockito/stubbing/ |
DeprecatedOngoingStubbing.java | 66 * Set a generic Answer for the stubbed method. E.g:
68 * stub(mock.someMethod(10)).toAnswer(new Answer<Integer>() {
69 * public Integer answer(InvocationOnMock invocation) throws Throwable {
75 * @param answer the custom answer to execute.
79 DeprecatedOngoingStubbing<T> toAnswer(Answer<?> answer);
|
VoidMethodStubbable.java | 70 * Stubs a void method with generic {@link Answer}
75 * .toAnswer(new Answer() {
76 * public Object answer(InvocationOnMOck invocation) {
86 * @param answer the custom answer to execute.
90 VoidMethodStubbable<T> toAnswer(Answer<?> answer);
|
Stubber.java | 32 * {@link Mockito#doAnswer(Answer)}
60 * {@link Mockito#doAnswer(Answer)}
103 * Use it for stubbing consecutive calls in {@link Mockito#doAnswer(Answer)} style:
109 * See javadoc for {@link Mockito#doAnswer(Answer)}
111 * @param answer to answer when the stubbed method is called
114 Stubber doAnswer(Answer answer);
|
/external/mockito/src/org/mockito/ |
BDDMockito.java | 7 import org.mockito.stubbing.Answer;
67 * See original {@link OngoingStubbing#thenAnswer(Answer)}
70 BDDMyOngoingStubbing<T> willAnswer(Answer<?> answer);
73 * See original {@link OngoingStubbing#then(Answer)}
76 BDDMyOngoingStubbing<T> will(Answer<?> answer);
124 * @see BDDMockito.BDDMyOngoingStubbing#willAnswer(Answer)
126 public BDDMyOngoingStubbing<T> willAnswer(Answer<?> answer) {
[all...] |
Mockito.java | 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}
[all...] |
/external/mockito/src/org/mockito/internal/stubbing/ |
InvocationContainerImpl.java | 16 import org.mockito.stubbing.Answer; 29 private final List<Answer> answersForStubbing = new ArrayList<Answer>(); 48 public void addAnswer(Answer answer) { 50 addAnswer(answer, false); 53 public void addConsecutiveAnswer(Answer answer) { 54 addAnswer(answer, true); 57 public void addAnswer(Answer answer, boolean isConsecutive) [all...] |
VoidMethodStubbableImpl.java | 9 import org.mockito.stubbing.Answer;
31 public VoidMethodStubbable<T> toAnswer(Answer<?> answer) {
32 invocationContainerImpl.addAnswerForVoidMethod(answer);
|
/external/mockito/src/org/mockito/internal/stubbing/answers/ |
ClonesArguments.java | 10 import org.mockito.stubbing.Answer;
13 //TODO this needs documentation and further analysis - what if someone changes the answer?
15 public class ClonesArguments implements Answer<Object> {
16 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:ClonesArguments 24 return new ReturnsEmptyValues().answer(invocation);
|
ThrowsException.java | 10 import org.mockito.stubbing.Answer;
14 public class ThrowsException implements Answer<Object>, Serializable {
24 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:ThrowsException
|
ThrowsExceptionClass.java | 10 import org.mockito.stubbing.Answer; 15 public class ThrowsExceptionClass implements Answer<Object>, Serializable { 25 public Object answer(InvocationOnMock invocation) throws Throwable { method in class:ThrowsExceptionClass
|
ReturnsArgumentAt.java | 9 import org.mockito.stubbing.Answer; 22 public class ReturnsArgumentAt implements Answer<Object>, Serializable { 31 * Build the identity answer to return the argument at the given position in the argument array. 40 public Object answer(InvocationOnMock invocation) throws Throwable { method in class:ReturnsArgumentAt
|
AnswersValidator.java | 9 import org.mockito.stubbing.Answer;
15 public void validate(Answer<?> answer, Invocation invocation) {
17 if (answer instanceof ThrowsException) {
18 validateException((ThrowsException) answer, methodInfo);
21 if (answer instanceof Returns) {
22 validateReturnValue((Returns) answer, methodInfo);
25 if (answer instanceof DoesNothing) {
26 validateDoNothing((DoesNothing) answer, methodInfo);
29 if (answer instanceof CallsRealMethods) { [all...] |
/cts/tests/tests/print/src/android/print/cts/ |
PageRangeAdjustmentTest.java | 50 import org.mockito.stubbing.Answer; 71 new Answer<PrinterDiscoverySessionCallbacks>() { 73 public PrinterDiscoverySessionCallbacks answer(InvocationOnMock invocation) { 77 new Answer<Void>() { 79 public Void answer(InvocationOnMock invocation) { 97 new Answer<Void>() { 99 public Void answer(InvocationOnMock invocation) throws Throwable { 111 }, new Answer<Void>() { 113 public Void answer(InvocationOnMock invocation) throws Throwable { 125 }, new Answer<Void>() [all...] |
PrinterDiscoverySessionLifecycleTest.java | 46 import org.mockito.stubbing.Answer; 73 new Answer<PrinterDiscoverySessionCallbacks>() { 75 public PrinterDiscoverySessionCallbacks answer(InvocationOnMock invocation) { 79 new Answer<Void>() { 81 public Void answer(InvocationOnMock invocation) { 170 new Answer<PrinterDiscoverySessionCallbacks>() { 172 public PrinterDiscoverySessionCallbacks answer(InvocationOnMock invocation) { 176 new Answer<Void>() { 178 public Void answer(InvocationOnMock invocation) { 310 return createMockPrinterDiscoverySessionCallbacks(new Answer<Void>() 342 public Void answer(InvocationOnMock invocation) throws Throwable { method 390 public Void answer(InvocationOnMock invocation) throws Throwable { method [all...] |
PrintDocumentAdapterContractTest.java | 49 import org.mockito.stubbing.Answer; 73 new Answer<Void>() { 75 public Void answer(InvocationOnMock invocation) throws Throwable { 87 }, new Answer<Void>() { 89 public Void answer(InvocationOnMock invocation) throws Throwable { 101 }, new Answer<Void>() { 103 public Void answer(InvocationOnMock invocation) throws Throwable { 193 new Answer<Void>() { 195 public Void answer(InvocationOnMock invocation) throws Throwable { 206 }, new Answer<Void>() 1654 public Void answer(InvocationOnMock invocation) throws Throwable { method [all...] |
BasePrintTest.java | 61 import org.mockito.stubbing.Answer; 414 protected PrintDocumentAdapter createMockPrintDocumentAdapter(Answer<Void> layoutAnswer, 415 Answer<Void> writeAnswer, Answer<Void> finishAnswer) { 436 Answer<Void> onStartPrinterDiscovery, Answer<Void> onStopPrinterDiscovery, 437 Answer<Void> onValidatePrinters, Answer<Void> onStartPrinterStateTracking, 438 Answer<Void> onStopPrinterStateTracking, Answer<Void> onDestroy) [all...] |
/external/mockito/src/org/mockito/internal/creation/settings/ |
CreationSettings.java | 10 import org.mockito.stubbing.Answer; 28 protected Answer<Object> defaultAnswer; 75 public Answer<Object> getDefaultAnswer() {
|
/packages/apps/Messaging/tests/src/com/android/messaging/ui/mediapicker/ |
MockCameraFactory.java | 25 import org.mockito.stubbing.Answer; 51 Mockito.when(wrapper.open(Mockito.anyInt())).then(new Answer<Camera>() { 53 public Camera answer(InvocationOnMock invocation) { 57 Mockito.doAnswer(new Answer<Void>() { 59 public Void answer(InvocationOnMock invocation) throws Throwable {
|
/external/mockito/src/org/mockito/internal/configuration/ |
GlobalConfiguration.java | 11 import org.mockito.stubbing.Answer;
66 public Answer<Object> getDefaultAnswer() {
|
/packages/apps/InCallUI/tests/src/com/android/incallui/ |
MockCallListWrapper.java | 27 import org.mockito.stubbing.Answer; 42 when(mCallList.getFirstCallWithState(anyInt())).thenAnswer(new Answer<Call>() { 44 public Call answer(InvocationOnMock i) throws Throwable {
|
/packages/apps/ManagedProvisioning/tests/src/com/android/managedprovisioning/task/ |
InstallPackageTaskTest.java | 41 import org.mockito.stubbing.Answer; 99 Answer installerAnswer = new Answer() { 101 public Object answer(InvocationOnMock invocation) throws Throwable { 125 Answer installerAnswer = new Answer() { 127 public Object answer(InvocationOnMock invocation) throws Throwable {
|
/frameworks/volley/src/test/java/com/android/volley/ |
RequestQueueIntegrationTest.java | 30 import org.mockito.stubbing.Answer; 73 Answer<NetworkResponse> delayAnswer = new Answer<NetworkResponse>() { 75 public NetworkResponse answer(InvocationOnMock invocationOnMock) throws Throwable { 111 Answer<NetworkResponse> delayAnswer = new Answer<NetworkResponse>() { 113 public NetworkResponse answer(InvocationOnMock invocationOnMock) throws Throwable { 144 Answer<NetworkResponse> delayAnswer = new Answer<NetworkResponse>() { 146 public NetworkResponse answer(InvocationOnMock invocationOnMock) throws Throwable [all...] |
/external/mockito/src/org/mockito/internal/stubbing/defaultanswers/ |
ReturnsDeepStubs.java | 16 import org.mockito.stubbing.Answer;
27 * <p>Supports nested generic information, with this answer you can write code like this :
40 public class ReturnsDeepStubs implements Answer<Object>, Serializable {
47 public Object answer(InvocationOnMock invocation) throws Throwable {
method in class:ReturnsDeepStubs 66 return stubbedInvocationMatcher.answer(invocation);
79 * {@link ReturnsDeepStubs} answer in which we will store the returned type generic metadata.
112 container.addAnswer(new Answer<Object>() {
113 public Object answer(InvocationOnMock invocation) throws Throwable {
|
/external/mockito/src/org/mockito/internal/handler/ |
InvocationNotifierHandler.java | 15 import org.mockito.stubbing.Answer;
76 public void setAnswersForStubbing(List<Answer> answers) {
|
/external/mockito/src/org/mockito/internal/creation/ |
MockSettingsImpl.java | 18 import org.mockito.stubbing.Answer;
75 public MockSettings defaultAnswer(Answer defaultAnswer) {
83 public Answer<Object> getDefaultAnswer() {
|