Home
last modified time | relevance | path

Searched refs:MockResponse (Results 1 – 25 of 42) sorted by relevance

12

/packages/modules/AdServices/adservices/tests/perf/src/android/adservices/test/scenario/adservices/measurement/load/utils/
DMeasurementMockResponseFactory.java19 import com.google.mockwebserver.MockResponse;
39 public static MockResponse createRegisterSourceResponse() { in createRegisterSourceResponse()
40 final MockResponse mockRegisterSourceResponse = new MockResponse(); in createRegisterSourceResponse()
64 public static MockResponse createRegisterTriggerResponse() { in createRegisterTriggerResponse()
65 final MockResponse mockRegisterTriggerResponse = new MockResponse(); in createRegisterTriggerResponse()
96 public static MockResponse createRegisterWebSourceResponse() { in createRegisterWebSourceResponse()
97 final MockResponse mockRegisterWebSourceResponse = new MockResponse(); in createRegisterWebSourceResponse()
121 public static MockResponse createRegisterWebTriggerResponse() { in createRegisterWebTriggerResponse()
122 final MockResponse mockRegisterWebTriggerResponse = new MockResponse(); in createRegisterWebTriggerResponse()
153 public static MockResponse createEventReportUploadResponse() { in createEventReportUploadResponse()
[all …]
/packages/modules/AdServices/adservices/tests/cts/src/android/adservices/debuggablects/
DMeasurementCtsDebuggableTest.java40 import com.google.mockwebserver.MockResponse;
187 private MockWebServer startServer(int port, MockResponse... mockResponses) { in startServer()
218 private MockResponse createRegisterSourceResponse() { in createRegisterSourceResponse()
219 final MockResponse mockRegisterSourceResponse = new MockResponse(); in createRegisterSourceResponse()
240 private MockResponse createRegisterTriggerResponse() { in createRegisterTriggerResponse()
241 final MockResponse mockRegisterTriggerResponse = new MockResponse(); in createRegisterTriggerResponse()
269 private MockResponse createRegisterWebSourceResponse() { in createRegisterWebSourceResponse()
270 final MockResponse mockRegisterWebSourceResponse = new MockResponse(); in createRegisterWebSourceResponse()
291 private MockResponse createRegisterWebTriggerResponse() { in createRegisterWebTriggerResponse()
292 final MockResponse mockRegisterWebTriggerResponse = new MockResponse(); in createRegisterWebTriggerResponse()
[all …]
/packages/modules/AdServices/adservices/tests/perf/src/android/adservices/test/scenario/adservices/
DMeasurementRegisterCalls.java42 import com.google.mockwebserver.MockResponse;
170 private MockWebServer startServer(int port, MockResponse... mockResponses) { in startServer()
197 private MockResponse createRegisterSourceResponse() { in createRegisterSourceResponse()
198 final MockResponse mockRegisterSourceResponse = new MockResponse(); in createRegisterSourceResponse()
219 private MockResponse createRegisterTriggerResponse() { in createRegisterTriggerResponse()
220 final MockResponse mockRegisterTriggerResponse = new MockResponse(); in createRegisterTriggerResponse()
248 private MockResponse createRegisterWebSourceResponse() { in createRegisterWebSourceResponse()
249 final MockResponse mockRegisterWebSourceResponse = new MockResponse(); in createRegisterWebSourceResponse()
270 private MockResponse createRegisterWebTriggerResponse() { in createRegisterWebTriggerResponse()
271 final MockResponse mockRegisterWebTriggerResponse = new MockResponse(); in createRegisterWebTriggerResponse()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/httpclient/
DAdServicesHttpsClientTest.java93 import com.google.mockwebserver.MockResponse;
179 mMockWebServerRule.startMockWebServer(ImmutableList.of(new MockResponse())); in testGetAndReadNothingSuccessfulResponse()
188 mMockWebServerRule.startMockWebServer(ImmutableList.of(new MockResponse())); in testGetAndReadNothingSuccessfulResponse_DevOptionsEnabled()
197 mMockWebServerRule.startMockWebServer(ImmutableList.of(new MockResponse())); in testGetAndReadNothingCorrectPath()
210 ImmutableList.of(new MockResponse().setResponseCode(305))); in testGetAndReadNothingFailedResponse()
222 mMockWebServerRule.startMockWebServer(ImmutableList.of(new MockResponse())); in testGetAndReadNothingDomainDoesNotExist()
248 ImmutableList.of(new MockResponse().setBody(mJsScript))); in testFetchPayloadSuccessfulResponse()
260 ImmutableList.of(new MockResponse().setBody(mJsScript))); in testFetchPayloadSuccessfulResponse_DevOptionsEnabled()
272 ImmutableList.of(new MockResponse().setBody(mJsScript))); in testFetchPayloadCorrectPath()
285 ImmutableList.of(new MockResponse().setResponseCode(305))); in testFetchPayloadFailedResponse()
[all …]
/packages/modules/AdServices/adservices/tests/perf/src/android/adservices/test/scenario/adservices/fledge/
DBaselinePerfTest.java27 import com.google.mockwebserver.MockResponse;
184 public MockResponse dispatch(RecordedRequest request) { in testAdSelectionAndReporting_executionHeavyJS_success()
186 return new MockResponse().setBody(calculation_intense_logic_js); in testAdSelectionAndReporting_executionHeavyJS_success()
188 return new MockResponse().setBody(DEFAULT_BIDDING_LOGIC_JS); in testAdSelectionAndReporting_executionHeavyJS_success()
191 return new MockResponse().setBody(""); in testAdSelectionAndReporting_executionHeavyJS_success()
193 return new MockResponse().setBody(TRUSTED_SCORING_SIGNALS.toString()); in testAdSelectionAndReporting_executionHeavyJS_success()
195 return new MockResponse().setBody(TRUSTED_BIDDING_SIGNALS.toString()); in testAdSelectionAndReporting_executionHeavyJS_success()
197 return new MockResponse().setResponseCode(404); in testAdSelectionAndReporting_executionHeavyJS_success()
266 public MockResponse dispatch(RecordedRequest request) { in testAdSelectionAndReporting_memoryHeavyJS_success()
268 return new MockResponse().setBody(memory_intense_logic_js); in testAdSelectionAndReporting_memoryHeavyJS_success()
[all …]
DAbstractPerfTest.java45 import com.google.mockwebserver.MockResponse;
206 public MockResponse dispatch(RecordedRequest request) { in setup()
208 return new MockResponse().setBody(DEFAULT_DECISION_LOGIC_JS); in setup()
210 return new MockResponse().setBody(DEFAULT_BIDDING_LOGIC_JS); in setup()
213 return new MockResponse().setBody(""); in setup()
215 return new MockResponse().setBody(TRUSTED_SCORING_SIGNALS.toString()); in setup()
217 return new MockResponse().setBody(TRUSTED_BIDDING_SIGNALS.toString()); in setup()
219 return new MockResponse().setResponseCode(404); in setup()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/signals/
DSignalsEncodingE2ETest.java91 import com.google.mockwebserver.MockResponse;
362 MockResponse signalsResponse = new MockResponse().setBody(json); in testSignalsEncoding_Success()
363 MockResponse encoderResponse = new MockResponse().setBody(encodeSignalsJS); in testSignalsEncoding_Success()
369 public MockResponse dispatch(RecordedRequest request) in testSignalsEncoding_Success()
377 return new MockResponse().setResponseCode(404); in testSignalsEncoding_Success()
462 MockResponse signalsResponse1 = new MockResponse().setBody(json1); in testSecondUpdateEncoderDoesNotDownloadEncodingLogic()
463 MockResponse encoderResponse1 = new MockResponse().setBody(encodeSignalsJS1); in testSecondUpdateEncoderDoesNotDownloadEncodingLogic()
481 MockResponse signalsResponse2 = new MockResponse().setBody(json2); in testSecondUpdateEncoderDoesNotDownloadEncodingLogic()
482 MockResponse encoderResponse2 = new MockResponse().setBody(encodeSignalsJS2); in testSecondUpdateEncoderDoesNotDownloadEncodingLogic()
488 public MockResponse dispatch(RecordedRequest request) in testSecondUpdateEncoderDoesNotDownloadEncodingLogic()
[all …]
DSignalsIntakeE2ETest.java94 import com.google.mockwebserver.MockResponse;
469 MockResponse response1 = new MockResponse().setBody(json1); in testComplexJson()
470 MockResponse response2 = new MockResponse().setBody(json2); in testComplexJson()
525 MockResponse response1 = new MockResponse().setBody(json1); in testOverwriteAppendWithPut()
526 MockResponse response2 = new MockResponse().setBody(json2); in testOverwriteAppendWithPut()
565 MockResponse response1 = new MockResponse().setBody(json1); in testAddToPutWithAppend()
566 MockResponse response2 = new MockResponse().setBody(json2); in testAddToPutWithAppend()
609 MockResponse response = new MockResponse().setBody(json); in testBadAppend()
654 MockResponse response = new MockResponse().setBody(json); in testCollision()
674 MockResponse response1 = new MockResponse().setBody(badJson); in testFailure()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/
DReportAndRegisterEventFallbackImplTest.java104 import com.google.mockwebserver.MockResponse;
274 List.of(new MockResponse(), new MockResponse())); in testImplSuccessfullyReportsRegisteredEvents()
326 public MockResponse dispatch(RecordedRequest request) { in testImplDoesNotCrashAfterSellerReportingThrowsAnException()
328 return new MockResponse(); in testImplDoesNotCrashAfterSellerReportingThrowsAnException()
379 public MockResponse dispatch(RecordedRequest request) { in testImplDoesNotCrashAfterSellerReportingAndRegisteringThrowsAnException()
381 return new MockResponse(); in testImplDoesNotCrashAfterSellerReportingAndRegisteringThrowsAnException()
447 public MockResponse dispatch(RecordedRequest request) { in testImplDoesNotCrashAfterBuyerReportingThrowsAnException()
449 return new MockResponse(); in testImplDoesNotCrashAfterBuyerReportingThrowsAnException()
500 public MockResponse dispatch(RecordedRequest request) { in testImplDoesNotCrashAfterBuyerReportingAndRegisteringThrowsAnException()
502 return new MockResponse(); in testImplDoesNotCrashAfterBuyerReportingAndRegisteringThrowsAnException()
[all …]
DReportAndRegisterEventE2ETest.java128 import com.google.mockwebserver.MockResponse;
403 List.of(new MockResponse(), new MockResponse())); in testService_reportingDisabled()
450 List.of(new MockResponse(), new MockResponse())); in testService_onlyReportingEnabled()
492 List.of(new MockResponse(), new MockResponse())); in testService_ReportingAndRegisteringEnabled()
545 List.of(new MockResponse(), new MockResponse())); in testService_ReportingAndRegisteringEnabled_measurementKillSwitchEnabled()
598 List.of(new MockResponse(), new MockResponse())); in testService_ReportingAndRegisteringEnabled_appIsNotInMeasurementAllowlisted()
649 List.of(new MockResponse(), new MockResponse())); in testService_ReportingAndRegisteringEnabled_measurementConsentRevoked()
699 List.of(new MockResponse(), new MockResponse())); in testService_ReportingAndRegisteringEnabled_noPermissionForARA()
752 new MockResponse(), in testService_ReportingAndRegisteringFallbackEnabled()
753 new MockResponse(), in testService_ReportingAndRegisteringFallbackEnabled()
[all …]
DReportEventImplTest.java100 import com.google.mockwebserver.MockResponse;
294 List.of(new MockResponse(), new MockResponse())); in testImplSuccessfullyReportsRegisteredInteractions()
367 public MockResponse dispatch(RecordedRequest request) { in testImplDoesNotCrashAfterSellerReportingThrowsAnException()
370 return new MockResponse(); in testImplDoesNotCrashAfterSellerReportingThrowsAnException()
452 public MockResponse dispatch(RecordedRequest request) { in testImplDoesNotCrashAfterBuyerReportingThrowsAnException()
455 return new MockResponse(); in testImplDoesNotCrashAfterBuyerReportingThrowsAnException()
530 public MockResponse dispatch(RecordedRequest request) { in testImplOnlyReportsBuyersRegisteredInteractions()
533 return new MockResponse(); in testImplOnlyReportsBuyersRegisteredInteractions()
601 public MockResponse dispatch(RecordedRequest request) { in testImplOnlyReportsSellerRegisteredInteractions()
604 return new MockResponse(); in testImplOnlyReportsSellerRegisteredInteractions()
[all …]
DAdSelectionE2ETest.java172 import com.google.mockwebserver.MockResponse;
358 public MockResponse dispatch(RecordedRequest request) {
360 return new MockResponse().setBody(USE_BID_AS_SCORE_JS);
365 return new MockResponse().setBody(READ_BID_FROM_AD_METADATA_JS);
367 return new MockResponse().setBody(SELECTION_PICK_HIGHEST_LOGIC_JS);
369 return new MockResponse().setBody(SELECTION_PICK_NONE_LOGIC_JS);
371 return new MockResponse().setBody(SELECTION_WATERFALL_LOGIC_JS);
381 return new MockResponse().setBody(new JSONObject(jsonMap).toString());
390 return new MockResponse().setBody(TRUSTED_SCORING_SIGNALS.toString());
393 return new MockResponse().setResponseCode(404);
[all …]
DAdSelectionServiceImplTest.java174 import com.google.mockwebserver.MockResponse;
483 new MockResponse().setBody(sellerDecisionLogicJs), in testReportImpressionSuccessWithRegisterAdBeaconDisabled()
484 new MockResponse(), in testReportImpressionSuccessWithRegisterAdBeaconDisabled()
485 new MockResponse())); in testReportImpressionSuccessWithRegisterAdBeaconDisabled()
611 new MockResponse().setBody(sellerDecisionLogicJs), in testReportImpressionSuccessCallbackThrowsErrorAuctionServerEnabled()
612 new MockResponse(), in testReportImpressionSuccessCallbackThrowsErrorAuctionServerEnabled()
613 new MockResponse())); in testReportImpressionSuccessCallbackThrowsErrorAuctionServerEnabled()
739 new MockResponse().setBody(sellerDecisionLogicJs), in testReportImpressionFailureCallbackThrowsErrorAuctionServerEnabled()
740 new MockResponse(), in testReportImpressionFailureCallbackThrowsErrorAuctionServerEnabled()
741 new MockResponse())); in testReportImpressionFailureCallbackThrowsErrorAuctionServerEnabled()
[all …]
DAdSelectionFailureE2ETest.java116 import com.google.mockwebserver.MockResponse;
339 public MockResponse dispatch(RecordedRequest request) { in setUp()
341 return new MockResponse() in setUp()
347 return new MockResponse() in setUp()
353 return new MockResponse().setBody(""); in setUp()
355 return new MockResponse().setBody(""); in setUp()
366 return new MockResponse().setBody(new JSONObject(jsonMap).toString()); in setUp()
375 return new MockResponse().setBody(TRUSTED_SCORING_SIGNALS.toString()); in setUp()
378 return new MockResponse().setResponseCode(404); in setUp()
/packages/modules/AdServices/adservices/tests/perf/src/android/adservices/test/scenario/adservices/utils/
DMockWebServerDispatcherFactory.java23 import com.google.mockwebserver.MockResponse;
159 public MockResponse dispatch(RecordedRequest request) { in create()
162 return new MockResponse() in create()
174 return new MockResponse() in create()
186 return new MockResponse() in create()
200 return new MockResponse().setBody(""); in create()
202 return new MockResponse() in create()
209 return new MockResponse() in create()
216 return new MockResponse().setResponseCode(404); in create()
DMockWebServerRule.java26 import com.google.mockwebserver.MockResponse;
98 public MockWebServer startMockWebServer(List<MockResponse> responses) throws Exception { in startMockWebServer()
107 for (MockResponse response : responses) { in startMockWebServer()
114 public MockWebServer startMockWebServer(Function<RecordedRequest, MockResponse> lambda) in startMockWebServer()
119 public MockResponse dispatch(RecordedRequest request) { in startMockWebServer()
/packages/modules/AdServices/adservices/tests/cts/src/android/adservices/utils/
DScenario.java34 private final ImmutableMap<Request, MockResponse> mScenarioMap;
42 Scenario(ImmutableMap<Request, MockResponse> scenarioMap) { in Scenario()
51 public ImmutableMap<Request, MockResponse> getScenarioMap() { in getScenarioMap()
111 public abstract static class MockResponse { class in Scenario
181 abstract MockResponse build(); in build()
DScenarioDispatcher.java28 import com.google.mockwebserver.MockResponse;
57 private final ImmutableMap<Scenario.Request, Scenario.MockResponse> mRequestToMockMap;
155 public MockResponse dispatch(RecordedRequest request) throws InterruptedException { in dispatch()
167 Scenario.MockResponse mock = mRequestToMockMap.get(mockRequest); in dispatch()
186 MockResponse response = new MockResponse().setBody(body).setResponseCode(200); in dispatch()
203 return new MockResponse().setResponseCode(404); in dispatch()
DMockWebServerRule.java26 import com.google.mockwebserver.MockResponse;
106 public MockWebServer startMockWebServer(List<MockResponse> responses, int port) in startMockWebServer()
112 for (MockResponse response : responses) { in startMockWebServer()
119 public MockWebServer startMockWebServer(Function<RecordedRequest, MockResponse> lambda) in startMockWebServer()
124 public MockResponse dispatch(RecordedRequest request) { in startMockWebServer()
DScenarioLoader.java71 ImmutableMap.Builder<Scenario.Request, Scenario.MockResponse> builder = in parseScenario()
76 Pair<Scenario.Request, Scenario.MockResponse> mock = parseMock(mockObject, variables); in parseScenario()
82 private static Pair<Scenario.Request, Scenario.MockResponse> parseMock( in parseMock()
95 Scenario.MockResponse parsedMock = in parseMock()
96 Scenario.MockResponse.newBuilder() in parseMock()
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/
DAbstractDownloadProviderFunctionalTest.java47 import com.google.mockwebserver.MockResponse;
271 void enqueueResponse(MockResponse resp) { in enqueueResponse()
275 MockResponse buildResponse(int status, String body) { in buildResponse()
276 return new MockResponse().setResponseCode(status).setBody(body) in buildResponse()
281 MockResponse buildResponse(int status, byte[] body) { in buildResponse()
282 return new MockResponse().setResponseCode(status).setBody(body) in buildResponse()
287 MockResponse buildEmptyResponse(int status) { in buildEmptyResponse()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/customaudience/
DFetchCustomAudienceImplTest.java141 import com.google.mockwebserver.MockResponse;
294 new MockResponse() in testImpl_disabled()
705 List.of(new MockResponse().setBody("Not[A]VALID[JSON]"))); in testImpl_invalidResponse_invalidJSONObject()
733 List.of(new MockResponse().setBody(validResponse.toString()))); in testImpl_invalidFused_missingField()
761 List.of(new MockResponse().setBody(validResponse.toString()))); in testImpl_invalidFused_missingFieldAuctionServerFlagsEnabled()
789 List.of(new MockResponse().setBody(invalidResponse.toString()))); in testImpl_invalidFused_invalidField()
833 new MockResponse() in testImpl_invalidFused_exceedsSizeLimit()
864 List.of(new MockResponse().setBody(partialResponse.toString()))); in testImpl_runNormally_partialResponse()
890 List.of(new MockResponse().setBody(validResponse.toString()))); in testImpl_runNormally_discardedResponseValues()
913 new MockResponse() in testImpl_runNormally_completeResponse()
[all …]
DBackgroundFetchRunnerTest.java66 import com.google.mockwebserver.MockResponse;
344 new MockResponse() in testFetchAndValidateSuccessfulEmptyCustomAudienceUpdatableData()
372 new MockResponse() in testFetchAndValidateSuccessfulFullCustomAudienceUpdatableData()
436 List.of(new MockResponse().setBody(jsonResponseString))); in testFetchAndValidateSuccessfulFullCustomAudienceUpdatableDataWithAuctionServerRequestFlagsEnabled()
498 List.of(new MockResponse().setBody(jsonResponseString))); in testFetchAndValidateSuccessfulFullCustomAudienceUpdatableDataWithAuctionServerRequestFlagsDisabled()
546 public MockResponse dispatch(RecordedRequest request) in testFetchAndValidateCustomAudienceUpdatableDataNetworkTimeout()
550 return new MockResponse() in testFetchAndValidateCustomAudienceUpdatableDataNetworkTimeout()
591 new MockResponse() in testFetchWithInvalidUriAndValidateCustomAudienceUpdatableData()
635 new MockResponse() in testFetchAndValidateCustomAudienceUpdatableDataResponseTooLarge()
666 new MockResponse() in testFetchAndValidateCustomAudienceUpdatableDataDebuggable()
DCustomAudienceServiceEndToEndTest.java134 import com.google.mockwebserver.MockResponse;
653 new MockResponse() in testFetchAndJoinCustomAudience_overridesJoinCustomAudience()
702 new MockResponse() in testFetchAndJoinCustomAudienceAppInstallDisabled()
752 new MockResponse() in testFetchAndJoinCustomAudienceFrequencyCapDisabled()
807 new MockResponse() in testFetchAndJoinCustomAudience_overridesJoinCustomAudienceWithAuctionServerReqeustFlagsEnabled()
844 new MockResponse() in testFetchAndJoinCustomAudience_overriddenByJoinCustomAudience()
898 new MockResponse() in testFetchAndJoinCustomAudience_overriddenByJoinCustomAudienceWithAuctionServerRequestFlag()
946 List.of(new MockResponse().setResponseCode(429))); in testFetchAndJoinCustomAudience_FirstJoinsQuarantineTableSecondIsFiltered()
1003 new MockResponse().setResponseCode(429).setHeader("Retry-After", 1), in testFetchAndJoinCustomAudience_FirstJoinsQuarantineTableSecondPasses()
1004 new MockResponse() in testFetchAndJoinCustomAudience_FirstJoinsQuarantineTableSecondPasses()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/android/adservices/http/
DMockWebServerRule.java27 import com.google.mockwebserver.MockResponse;
128 public MockWebServer startMockWebServer(List<MockResponse> responses) throws Exception { in startMockWebServer()
131 for (MockResponse response : responses) { in startMockWebServer()
137 public MockWebServer startMockWebServer(Function<RecordedRequest, MockResponse> lambda)
142 public MockResponse dispatch(RecordedRequest request) {

12