@Test public void sendsTheCorrectBodyPostingAnEvent() throws Exception { MapboxTelemetry.applicationContext = getMockedContext(); TelemetryClient telemetryClient = obtainATelemetryClient("anyAccessToken", "anyUserAgent", REFORMED_USER_AGENT, MapboxTelemetry.applicationContext); List<Event> theEvent = obtainAnEvent(); Callback mockedCallback = mock(Callback.class); enqueueMockResponse(); telemetryClient.sendEvents(theEvent, mockedCallback, false); ArrayList<Event> events = new ArrayList<>(1); events.add(theEvent.get(0)); assertRequestBodyEquals(new Gson().toJson(events)); }
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);   }