Home
last modified time | relevance | path

Searched refs:invocation (Results 1 – 25 of 389) sorted by relevance

12345678910>>...16

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/fixture/
DTestableSystemProperties.java31 import org.mockito.invocation.InvocationOnMock;
51 ExtendedMockito.doAnswer(invocation -> getIntValue(invocation)) in setUpMockBehaviors()
53 ExtendedMockito.doAnswer(invocation -> getLongValue(invocation)) in setUpMockBehaviors()
55 ExtendedMockito.doAnswer(invocation -> getBooleanValue(invocation)) in setUpMockBehaviors()
57 ExtendedMockito.doAnswer(invocation -> getStringValue(invocation)) in setUpMockBehaviors()
59 ExtendedMockito.doAnswer(invocation -> getStringValueWithoutDefault(invocation)) in setUpMockBehaviors()
79 private static String getStringValueWithoutDefault(InvocationOnMock invocation) { in getStringValueWithoutDefault() argument
80 String key = invocation.getArgument(0); in getStringValueWithoutDefault()
82 logGetterCall(invocation, valueToReturn); in getStringValueWithoutDefault()
86 private static String getStringValue(InvocationOnMock invocation) { in getStringValue() argument
[all …]
/packages/modules/AdServices/shared/libraries/device-side/java/com/android/adservices/mockito/
DLogInterceptor.java63 invocation -> { in forTagAndLevels()
64 Log.d(TAG, invocation.toString()); in forTagAndLevels()
68 invocation.getArgument(0), in forTagAndLevels()
69 invocation.getArgument(1))); in forTagAndLevels()
70 invocation.callRealMethod(); in forTagAndLevels()
76 invocation -> { in forTagAndLevels()
77 Log.d(TAG, invocation.toString()); in forTagAndLevels()
81 invocation.getArgument(0), in forTagAndLevels()
82 invocation.getArgument(1), in forTagAndLevels()
83 invocation.getArgument(2))); in forTagAndLevels()
[all …]
/packages/modules/AdServices/shared/tests/device-side/java/com/android/adservices/shared/testing/mockito/
DMockitoHelperTest.java27 import org.mockito.invocation.InvocationOnMock;
59 String toString = MockitoHelper.toString(mAnswer.invocation); in testToString_oneArgument()
61 expect.withMessage("MockitoHelper.toString(%s)", mAnswer.invocation) in testToString_oneArgument()
71 String toString = MockitoHelper.toString(mAnswer.invocation); in testToString_oneArgument_null()
73 expect.withMessage("MockitoHelper.toString(%s)", mAnswer.invocation) in testToString_oneArgument_null()
83 String toString = MockitoHelper.toString(mAnswer.invocation); in testToString_multipleArguments()
85 expect.withMessage("MockitoHelper.toString(%s)", mAnswer.invocation) in testToString_multipleArguments()
95 String toString = MockitoHelper.toString(mAnswer.invocation); in testToString_multipleArguments_null()
97 expect.withMessage("MockitoHelper.toString(%s)", mAnswer.invocation) in testToString_multipleArguments_null()
107 String toString = MockitoHelper.toString(mAnswer.invocation); in testToString_varArgs()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/hal/
DPropertyHalServiceTest.java91 import org.mockito.invocation.InvocationOnMock;
242 private Object deliverResult(InvocationOnMock invocation, Integer expectedServiceRequestId, in deliverResult() argument
250 invocation, expectedServiceRequestId, carPropertyErrorCodes, propValue, get); in deliverResult()
253 private Object deliverResult(InvocationOnMock invocation, Integer expectedServiceRequestId, in deliverResult() argument
255 Object[] args = invocation.getArguments(); in deliverResult()
301 private Object deliverOkayGetResult(InvocationOnMock invocation) { in deliverOkayGetResult() argument
302 return deliverOkayGetResult(invocation, mPropValue); in deliverOkayGetResult()
305 private Object deliverOkayGetResult(InvocationOnMock invocation, HalPropValue propValue) { in deliverOkayGetResult() argument
306 return deliverResult(invocation, /* expectedServiceRequestId= */ null, in deliverOkayGetResult()
310 private Object deliverOkayGetResult(InvocationOnMock invocation, in deliverOkayGetResult() argument
[all …]
/packages/modules/Uwb/androidx_backend/tests/src/androidx/core/uwb/backend/impl/internal/
DRangingControllerTest.java101 invocation -> {
102 Runnable t = invocation.getArgument(0);
205 invocation -> {
206 pfRangingSessionCallback.value = invocation.getArgument(2);
217 invocation -> {
242 invocation -> {
243 pfRangingSessionCallback.value = invocation.getArgument(2);
272 invocation -> {
273 pfRangingSessionCallback.value = invocation.getArgument(2);
284 invocation -> {
[all …]
DRangingControleeTest.java96 invocation -> {
97 Runnable t = invocation.getArgument(0);
176 invocation -> {
177 pfRangingSessionCallback.value = invocation.getArgument(2);
188 invocation -> {
212 invocation -> {
213 pfRangingSessionCallback.value = invocation.getArgument(2);
241 invocation -> {
242 pfRangingSessionCallback.value = invocation.getArgument(2);
253 invocation -> {
[all …]
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/
DTestUtils.java74 (invocation) -> { in makeSpyLogThrowExceptionForWtf() argument
75 throw new IllegalStateException((String) invocation.getArguments()[1]); in makeSpyLogThrowExceptionForWtf()
81 (invocation) -> { in makeSpyLogThrowExceptionForWtf() argument
82 throw (Throwable) invocation.getArguments()[2]; in makeSpyLogThrowExceptionForWtf()
94 (invocation) -> { in makeSpyLogDoLogErrorForWtf() argument
96 "Mock logging WTF: " + invocation.getArguments()[0], in makeSpyLogDoLogErrorForWtf()
97 (String) invocation.getArguments()[1]); in makeSpyLogDoLogErrorForWtf()
104 (invocation) -> { in makeSpyLogDoLogErrorForWtf() argument
106 "Mock logging WTF: " + invocation.getArguments()[0], in makeSpyLogDoLogErrorForWtf()
107 (String) invocation.getArguments()[1], in makeSpyLogDoLogErrorForWtf()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/
DSatelliteRepositoryTest.kt79 .thenAnswer { invocation -> in <lambda>() method
81 invocation.getArgument<OutcomeReceiver<Boolean, SatelliteException>>(1) in <lambda>()
95 ).thenAnswer { invocation -> in <lambda>() method
96 val callback = invocation.getArgument<SatelliteModemStateCallback>(1) in <lambda>()
109 ).thenAnswer { invocation -> in <lambda>() method
110 val callback = invocation.getArgument<SatelliteModemStateCallback>(1) in <lambda>()
148 .thenAnswer { invocation -> in <lambda>() method
150 invocation.getArgument<OutcomeReceiver<Boolean, SatelliteException>>(1) in <lambda>()
168 .thenAnswer { invocation -> in <lambda>() method
170 invocation.getArgument<OutcomeReceiver<Boolean, SatelliteException>>(1) in <lambda>()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/biometrics/combination/
DCombinedBiometricProfileSettingsTest.java131 doAnswer(invocation -> { in setUp()
132 final Preference preference = invocation.getArgument(0); in setUp()
136 doAnswer(invocation -> { in setUp()
137 final Preference preference = invocation.getArgument(0); in setUp()
140 doAnswer(invocation -> { in setUp()
141 final Preference preference = invocation.getArgument(0); in setUp()
145 doAnswer(invocation -> { in setUp()
146 final Preference preference = invocation.getArgument(0); in setUp()
150 doAnswer(invocation -> { in setUp()
151 final CharSequence key = invocation.getArgument(0); in setUp()
[all …]
/packages/modules/AdServices/adservices/tests/endtoends/src/com/android/adservices/measurement/
DMeasurementCompatibleManagerTest.java131 (invocation) -> { in testRegisterSource_callingApp_expectedAttributionSource()
174 (invocation) -> { in testRegisterSource_adIdEnabled_register()
181 (invocation) -> { in testRegisterSource_adIdEnabled_register() argument
182 ((AdServicesOutcomeReceiver) invocation.getArgument(1)) in testRegisterSource_adIdEnabled_register()
213 (invocation) -> { in testRegisterSource_adIdZeroOut_register()
220 (invocation) -> { in testRegisterSource_adIdZeroOut_register() argument
221 ((AdServicesOutcomeReceiver) invocation.getArgument(1)) in testRegisterSource_adIdZeroOut_register()
251 (invocation) -> { in testRegisterSource_adIdDisabled_register()
258 (invocation) -> { in testRegisterSource_adIdDisabled_register() argument
259 ((AdServicesOutcomeReceiver) invocation.getArgument(1)) in testRegisterSource_adIdDisabled_register()
[all …]
/packages/services/Car/libs/car-test-lib/src/android/car/test/mocks/
DMockSettings.java31 import org.mockito.invocation.InvocationOnMock;
59 invocation -> insertObjectFromInvocation(invocation, 1, 2); in setExpectations()
60 Answer<Integer> getIntAnswer = invocation -> in setExpectations()
61 getAnswer(invocation, Integer.class, 1, 2); in setExpectations()
62 Answer<String> getStringAnswer = invocation -> in setExpectations()
63 getAnswer(invocation, String.class, 1, INVALID_DEFAULT_INDEX); in setExpectations()
102 private Object insertObjectFromInvocation(InvocationOnMock invocation, int keyIndex, in insertObjectFromInvocation() argument
104 String key = (String) invocation.getArguments()[keyIndex]; in insertObjectFromInvocation()
105 Object value = invocation.getArguments()[valueIndex]; in insertObjectFromInvocation()
120 private <T> T getAnswer(InvocationOnMock invocation, Class<T> clazz, int keyIndex, in getAnswer() argument
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/bluetooth/
DFastPairProviderTest.java189 doAnswer(invocation -> { in setUp()
190 mAdvertisingSetCallback = (AdvertisingSetCallback) invocation.getArguments()[5]; in setUp()
195 doAnswer(invocation -> { in setUp()
203 doAnswer(invocation -> { in setUp()
204 mFastPairGattService = (BluetoothGattService) invocation.getArgument(0); in setUp()
207 doAnswer(invocation -> { in setUp()
211 doAnswer(invocation -> { in setUp()
241 doAnswer(invocation -> { in setupMockKeyStorage()
242 String key = (String) invocation.getArgument(0); in setupMockKeyStorage()
243 int value = (Integer) invocation.getArgument(1); in setupMockKeyStorage()
[all …]
DFastPairAccountKeyStorageTest.java98 doAnswer(invocation -> { in setUp()
99 String key = (String) invocation.getArgument(0); in setUp()
100 int value = (Integer) invocation.getArgument(1); in setUp()
104 return invocation.getMock(); in setUp()
108 doAnswer(invocation -> { in setUp()
109 String key = (String) invocation.getArgument(0); in setUp()
110 String value = (String) invocation.getArgument(1); in setUp()
112 return invocation.getMock(); in setUp()
116 doAnswer(invocation -> { in setUp()
117 String key = (String) invocation.getArgument(0); in setUp()
[all …]
/packages/modules/AdServices/shared/libraries/device-side/java/com/android/adservices/shared/testing/mockito/
DMockitoHelper.java21 import org.mockito.invocation.InvocationOnMock;
38 public static String toString(InvocationOnMock invocation) { in toString() argument
39 Objects.requireNonNull(invocation, "invocation cannot be null"); in toString()
42 return invocation.getMethod().getName() in toString()
46 Arrays.stream(invocation.getArguments()) in toString()
59 invocation); in toString()
60 return invocation.toString(); in toString()
/packages/modules/Connectivity/thread/tests/unit/src/android/net/thread/
DThreadNetworkControllerTest.java47 import org.mockito.invocation.InvocationOnMock;
102 private static IStateCallback getStateCallback(InvocationOnMock invocation) { in getStateCallback() argument
103 return (IStateCallback) invocation.getArguments()[0]; in getStateCallback()
106 private static IOperationReceiver getOperationReceiver(InvocationOnMock invocation) { in getOperationReceiver() argument
107 return (IOperationReceiver) invocation.getArguments()[0]; in getOperationReceiver()
110 private static IOperationReceiver getJoinReceiver(InvocationOnMock invocation) { in getJoinReceiver() argument
111 return (IOperationReceiver) invocation.getArguments()[1]; in getJoinReceiver()
114 private static IOperationReceiver getScheduleMigrationReceiver(InvocationOnMock invocation) { in getScheduleMigrationReceiver() argument
115 return (IOperationReceiver) invocation.getArguments()[1]; in getScheduleMigrationReceiver()
119 InvocationOnMock invocation) { in getSetTestNetworkAsUpstreamReceiver() argument
[all …]
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/opp/
DBluetoothOppTestUtils.java81 invocation -> { in setUpMockCursor()
82 String name = invocation.getArgument(0); in setUpMockCursor()
96 invocation -> { in setUpMockCursor()
97 int index = invocation.getArgument(0); in setUpMockCursor()
108 invocation -> { in setUpMockCursor()
109 int index = invocation.getArgument(0); in setUpMockCursor()
120 invocation -> { in setUpMockCursor()
121 int index = invocation.getArgument(0); in setUpMockCursor()
/packages/services/Iwlan/test/com/google/android/iwlan/epdg/
DSrvDnsResolverTest.java150 invocation -> { in testQueryGivesSrvAndIpAddressResponse()
151 final Executor executor = invocation.getArgument(5); in testQueryGivesSrvAndIpAddressResponse()
152 final DnsResolver.Callback<byte[]> callback = invocation.getArgument(7); in testQueryGivesSrvAndIpAddressResponse()
198 invocation -> { in testQueryGivesSrvResponseFollowUpQueriesGiveIpAddress()
199 Executor executor = invocation.getArgument(5); in testQueryGivesSrvResponseFollowUpQueriesGiveIpAddress()
200 DnsResolver.Callback<byte[]> callback = invocation.getArgument(7); in testQueryGivesSrvResponseFollowUpQueriesGiveIpAddress()
216 invocation -> { in testQueryGivesSrvResponseFollowUpQueriesGiveIpAddress()
217 Executor executor = invocation.getArgument(3); in testQueryGivesSrvResponseFollowUpQueriesGiveIpAddress()
219 invocation.getArgument(5); in testQueryGivesSrvResponseFollowUpQueriesGiveIpAddress()
260 invocation -> { in testInvalidResponseThrowsParseException()
[all …]
/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/
DSystemStateHelperTest.java284 doAnswer(invocation -> { in testDeviceOnEarCorrectlyDetected()
285 SensorEventListener listener = invocation.getArgument(0); in testDeviceOnEarCorrectlyDetected()
286 Sensor sensor = invocation.getArgument(1); in testDeviceOnEarCorrectlyDetected()
305 doAnswer(invocation -> { in testDeviceIsNotOnEarWithProxNotSensed()
306 SensorEventListener listener = invocation.getArgument(0); in testDeviceIsNotOnEarWithProxNotSensed()
307 Sensor sensor = invocation.getArgument(1); in testDeviceIsNotOnEarWithProxNotSensed()
325 doAnswer(invocation -> { in testDeviceIsNotOnEarWithWrongOrientation()
326 SensorEventListener listener = invocation.getArgument(0); in testDeviceIsNotOnEarWithWrongOrientation()
327 Sensor sensor = invocation.getArgument(1); in testDeviceIsNotOnEarWithWrongOrientation()
347 doAnswer(invocation -> { in testDeviceIsNotOnEarWithMissingSensor()
[all …]
/packages/apps/Messaging/tests/src/com/android/messaging/ui/mediapicker/
DMockCameraFactory.java24 import org.mockito.invocation.InvocationOnMock;
53 public Camera answer(InvocationOnMock invocation) { in createCameraWrapper()
54 return cameras[(Integer) invocation.getArguments()[0]]; in createCameraWrapper()
59 public Void answer(InvocationOnMock invocation) throws Throwable { in createCameraWrapper()
61 cameras[(Integer) invocation.getArguments()[0]], in createCameraWrapper()
62 (CameraInfo) invocation.getArguments()[1] in createCameraWrapper()
/packages/apps/TV/tests/unit/src/com/android/tv/util/
DTvInputManagerHelperTest.java34 import org.mockito.invocation.InvocationOnMock;
225 public Boolean answer(InvocationOnMock invocation) throws Throwable { in createMockTvInputManager()
226 TvInputInfo info = (TvInputInfo) invocation.getArguments()[0]; in createMockTvInputManager()
235 public String answer(InvocationOnMock invocation) throws Throwable { in createMockTvInputManager()
236 TvInputInfo info = (TvInputInfo) invocation.getArguments()[0]; in createMockTvInputManager()
245 public String answer(InvocationOnMock invocation) throws Throwable { in createMockTvInputManager()
246 TvInputInfo info = (TvInputInfo) invocation.getArguments()[0]; in createMockTvInputManager()
255 public TvInputInfo answer(InvocationOnMock invocation) in createMockTvInputManager()
257 String inputId = (String) invocation.getArguments()[0]; in createMockTvInputManager()
/packages/modules/Connectivity/Tethering/tests/unit/src/com/android/networkstack/tethering/
DOffloadHalHidlImplTest.java127 doAnswer(invocation -> { in testGetForwardedStats()
128 ((IOffloadControl.getForwardedStatsCallback) invocation.getArgument(1)) in testGetForwardedStats()
144 doAnswer(invocation -> { in doTestSetLocalPrefixes()
145 ((IOffloadControl.setLocalPrefixesCallback) invocation.getArgument(1)) in doTestSetLocalPrefixes()
166 doAnswer(invocation -> { in doTestSetDataLimit()
167 ((IOffloadControl.setDataLimitCallback) invocation.getArgument(2)) in doTestSetDataLimit()
189 doAnswer(invocation -> { in doTestSetDataWarningAndLimit()
191 .setDataWarningAndLimitCallback) invocation.getArgument(3)) in doTestSetDataWarningAndLimit()
224 doAnswer(invocation -> { in doTestSetUpstreamParameters()
225 ((IOffloadControl.setUpstreamParametersCallback) invocation.getArgument(4)) in doTestSetUpstreamParameters()
[all …]
/packages/services/Car/tests/carservice_test/src/com/android/car/telemetry/
DCarTelemetryManagerSpyServiceTest.java116 doAnswer((invocation) -> { in testGetFinishedReport_multipleReports() argument
124 ICarTelemetryReportListener listener = invocation.getArgument(/* index= */ 1); in testGetFinishedReport_multipleReports()
143 doAnswer((invocation) -> { in testGetFinishedReport_validFdButNoReport() argument
145 ICarTelemetryReportListener listener = invocation.getArgument(/* index= */ 1); in testGetFinishedReport_validFdButNoReport()
165 doAnswer((invocation) -> { in testGetFinishedReport_telemetryError() argument
166 ICarTelemetryReportListener listener = invocation.getArgument(/* index= */ 1); in testGetFinishedReport_telemetryError()
186 doAnswer((invocation) -> { in testGetFinishedReport_badFd_shouldReturnRuntimeErrorStatus() argument
187 ICarTelemetryReportListener listener = invocation.getArgument(/* index= */ 1); in testGetFinishedReport_badFd_shouldReturnRuntimeErrorStatus()
/packages/modules/Connectivity/staticlibs/testutils/devicetests/com/android/testutils/async/
DReadableDataAnswer.java19 import org.mockito.invocation.InvocationOnMock;
56 public Object answer(InvocationOnMock invocation) throws Throwable { in answer() argument
65 byte[] dst = invocation.<byte[]>getArgument(0); in answer()
66 int dstPos = invocation.<Integer>getArgument(1); in answer()
67 int dstLen = invocation.<Integer>getArgument(2); in answer()
/packages/services/Car/tests/common_utils/src/com/android/car/test/
DFakeHandlerWrapper.java52 Mockito.doAnswer(invocation -> { in FakeHandlerWrapper()
53 Message msg = invocation.getArgument(0); in FakeHandlerWrapper()
54 msg.when = invocation.getArgument(1); // uptimeMillis in FakeHandlerWrapper()
62 Mockito.doAnswer(invocation -> { in FakeHandlerWrapper()
63 Runnable callback = invocation.getArgument(0); in FakeHandlerWrapper()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/audio_util/
DBrowsablePlayerConnectorTest.java67 invocation -> { in setUp()
68 mConnectionCallback = invocation.getArgument(2); in setUp()
74 invocation -> { in setUp()
81 invocation -> { in setUp()
82 String id = invocation.getArgument(0); in setUp()
84 invocation.getArgument(1); in setUp()

12345678910>>...16