/** * Processes all queued events in background thread */ public void dispatch() { if (mOptOut) return; mDispatcher.forceDispatch(); }
/** * Processes all queued events in background thread */ public void dispatch() { if (mOptOut) return; mDispatcher.forceDispatch(); }
@Test public void testDispatch() { Tracker tracker = new Tracker(mMatomo, mTrackerBuilder); tracker.dispatch(); verify(mDispatcher).forceDispatch(); tracker.dispatch(); verify(mDispatcher, times(2)).forceDispatch(); }
@Test public void testDispatch() { Tracker tracker = new Tracker(mMatomo, mTrackerBuilder); tracker.dispatch(); verify(mDispatcher).forceDispatch(); tracker.dispatch(); verify(mDispatcher, times(2)).forceDispatch(); }
@Test public void testDispatch_optOut() { Tracker tracker = new Tracker(mMatomo, mTrackerBuilder); tracker.setOptOut(true); tracker.dispatch(); verify(mDispatcher, never()).forceDispatch(); tracker.setOptOut(false); tracker.dispatch(); verify(mDispatcher).forceDispatch(); }
@Test public void testDispatch_optOut() { Tracker tracker = new Tracker(mMatomo, mTrackerBuilder); tracker.setOptOut(true); tracker.dispatch(); verify(mDispatcher, never()).forceDispatch(); tracker.setOptOut(false); tracker.dispatch(); verify(mDispatcher).forceDispatch(); }