@Test public void testTrackEventInBackgroundNormalCallback() throws Exception { final Map<String, String> dimensions = new HashMap<>(); dimensions.put("key", "value"); final Semaphore done = new Semaphore(0); ParseAnalytics.trackEventInBackground("test", dimensions, new SaveCallback() { @Override public void done(ParseException e) { assertNull(e); done.release(); } }); assertTrue(done.tryAcquire(1, 10, TimeUnit.SECONDS)); verify(controller, times(1)).trackEventInBackground( eq("test"), eq(dimensions), isNull(String.class)); final Semaphore doneAgain = new Semaphore(0); ParseAnalytics.trackEventInBackground("test", new SaveCallback() { @Override public void done(ParseException e) { assertNull(e); doneAgain.release(); } }); assertTrue(doneAgain.tryAcquire(1, 10, TimeUnit.SECONDS)); verify(controller, times(1)).trackEventInBackground (eq("test"), Matchers.<Map<String, String>>eq(null), isNull(String.class)); }
public static void trackEventInBackground(String name, SaveCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(trackEventInBackground(name), callback); }
ParseAnalytics { public static void trackEventInBackground(String name, SaveCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(trackEventInBackground(name), callback); } }
ParseAnalytics { public static void trackEventInBackground(String name, SaveCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(trackEventInBackground(name), callback); }  }
ParseAnalytics { public static void trackEventInBackground(String name, SaveCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(trackEventInBackground(name), callback); }  static Task<Void> trackAppOpenedInBackground(Intent intent); static void trackAppOpenedInBackground(Intent intent, SaveCallback callback); static void trackEventInBackground(String name, SaveCallback callback); static void trackEventInBackground(String name, Map<String, String> dimensions, SaveCallback callback); static Task<Void> trackEventInBackground(String name); static Task<Void> trackEventInBackground(final String name,
                                                    Map<String, String> dimensions); }
ParseAnalytics { public static void trackEventInBackground(String name, SaveCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(trackEventInBackground(name), callback); }  static Task<Void> trackAppOpenedInBackground(Intent intent); static void trackAppOpenedInBackground(Intent intent, SaveCallback callback); static void trackEventInBackground(String name, SaveCallback callback); static void trackEventInBackground(String name, Map<String, String> dimensions, SaveCallback callback); static Task<Void> trackEventInBackground(String name); static Task<Void> trackEventInBackground(final String name,
                                                    Map<String, String> dimensions);  }