@Test public void parsesUnauthorizedRequestResponseProperlyPostingAnEvent() throws Exception { MapboxTelemetry.applicationContext = getMockedContext(); TelemetryClient telemetryClient = obtainATelemetryClient("anyAccessToken", "anyUserAgent", REFORMED_USER_AGENT, MapboxTelemetry.applicationContext); List<Event> theEvent = obtainAnEvent(); final CountDownLatch latch = new CountDownLatch(1); final AtomicReference<String> bodyRef = new AtomicReference<>(); final AtomicBoolean failureRef = new AtomicBoolean(); Callback aCallback = provideACallback(latch, bodyRef, failureRef); enqueueMockResponse(401, "unauthorizedRequestResponse.json"); telemetryClient.sendEvents(theEvent, aCallback, false); latch.await(); assertTelemetryResponseEquals(bodyRef.get(), "Unauthorized request, usually because of " + "invalid access_token query parameter"); assertFalse(failureRef.get()); }
void sendEvents(List<Event> events, Callback callback, boolean serializeNulls) { sendBatch(Collections.unmodifiableList(events), callback, serializeNulls); }
TelemetryClient { void sendEvents(List<Event> events, Callback callback, boolean serializeNulls) { sendBatch(Collections.unmodifiableList(events), callback, serializeNulls); } }
TelemetryClient { void sendEvents(List<Event> events, Callback callback, boolean serializeNulls) { sendBatch(Collections.unmodifiableList(events), callback, serializeNulls); } TelemetryClient(String accessToken, String userAgent, String reformedUserAgent, TelemetryClientSettings setting,
                  Logger logger, CertificateBlacklist certificateBlacklist, boolean isCnRegion); }
TelemetryClient { void sendEvents(List<Event> events, Callback callback, boolean serializeNulls) { sendBatch(Collections.unmodifiableList(events), callback, serializeNulls); } TelemetryClient(String accessToken, String userAgent, String reformedUserAgent, TelemetryClientSettings setting,
                  Logger logger, CertificateBlacklist certificateBlacklist, boolean isCnRegion);  }
TelemetryClient { void sendEvents(List<Event> events, Callback callback, boolean serializeNulls) { sendBatch(Collections.unmodifiableList(events), callback, serializeNulls); } TelemetryClient(String accessToken, String userAgent, String reformedUserAgent, TelemetryClientSettings setting,
                  Logger logger, CertificateBlacklist certificateBlacklist, boolean isCnRegion);   }