urbanairship-core/src/test/java/com/urbanairship/analytics/data/EventManagerTest.java
@Test
    public void testAddEventAfterNextSendTime() {
        CustomEvent customEvent = CustomEvent.newBuilder("event name").build();
        eventManager.addEvent(customEvent, "session");

        // Verify we add an event.
        verify(mockEventResolver, new Times(1)).insertEvent(customEvent, "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() == 10000L;
            }
        }));
    }
/**
     * Tests adding an event after the next send time schedules an upload with a 10 second delay.
     */
Tests adding an event after the next send time schedules an upload with a 10 second delay.
Tests adding an event after the next send time schedules an upload with a 10 second delay .
@Test
    public void testAddEventAfterNextSendTime() {
        CustomEvent customEvent = CustomEvent.newBuilder("event name").build();
        eventManager.addEvent(customEvent, "session");
        verify(mockEventResolver, new Times(1)).insertEvent(customEvent, "session");
        verify(mockDispatcher).dispatch(Mockito.argThat(new ArgumentMatcher<JobInfo>() {
            @Override
            public boolean matches(JobInfo jobInfo) {
                return jobInfo.getAction().equals("upload") && jobInfo.getInitialDelay() == 10000L;
            }
        }));
    }
@ Test public void testAddEventAfterNextSendTime ( ) { CustomEvent customEvent = CustomEvent . newBuilder ( "event name" ) . build ( ) ; eventManager . addEvent ( customEvent , "session" ) ; verify ( mockEventResolver , new Times ( 1 ) ) . insertEvent ( customEvent , "session" ) ; verify ( mockDispatcher ) . dispatch ( Mockito . argThat ( new ArgumentMatcher < JobInfo > ( ) { @ Override public boolean matches ( JobInfo jobInfo ) { return jobInfo . getAction ( ) . equals ( "upload" ) && jobInfo . getInitialDelay ( ) == 10000L ; } } ) ) ; }
Tests adding an event after the next send time schedules an upload with a 10 second delay.
Tests adding an event after the next send time schedules an upload with a 10 second delay .
// Verify we add an event. // Check it schedules an upload