urbanairship-core/src/test/java/com/urbanairship/analytics/data/EventManagerTest.java
@Test
    public void testAddingHighPriorityEvents() {
        // Set last send time to year 3005 so next send time is way in the future
        dataStore.put(EventManager.LAST_SEND_KEY, 32661446400000L);

        RegionEvent regionEvent = new RegionEvent("id", "source", RegionEvent.BOUNDARY_EVENT_ENTER);

        eventManager.addEvent(regionEvent, "session");

        // Check it schedules an upload
        verify(mockDispatcher).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals("upload") && jobInfo.getInitialDelay() == 0;
            }
        }));
    }
/**
     * Test adding a region event schedules an upload immediately.
     */
Test adding a region event schedules an upload immediately.
Test adding a region event schedules an upload immediately .
@Test
    public void testAddingHighPriorityEvents() {
        dataStore.put(EventManager.LAST_SEND_KEY, 32661446400000L);
        RegionEvent regionEvent = new RegionEvent("id", "source", RegionEvent.BOUNDARY_EVENT_ENTER);
        eventManager.addEvent(regionEvent, "session");
        verify(mockDispatcher).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals("upload") && jobInfo.getInitialDelay() == 0;
            }
        }));
    }
@ Test public void testAddingHighPriorityEvents ( ) { dataStore . put ( EventManager . LAST_SEND_KEY , 32661446400000L ) ; RegionEvent regionEvent = new RegionEvent ( "id" , "source" , RegionEvent . BOUNDARY_EVENT_ENTER ) ; eventManager . addEvent ( regionEvent , "session" ) ; verify ( mockDispatcher ) . dispatch ( Mockito . argThat ( new ArgumentMatcher < JobInfo > ( ) { @ Override public boolean matches ( JobInfo jobInfo ) { return jobInfo . getAction ( ) . equals ( "upload" ) && jobInfo . getInitialDelay ( ) == 0 ; } } ) ) ; }
Test adding a region event schedules an upload immediately.
Test adding a region event schedules an upload immediately .
// Set last send time to year 3005 so next send time is way in the future // Check it schedules an upload