urbanairship-core/src/test/java/com/urbanairship/analytics/AnalyticsTest.java
@Test
    public void testTrackingEventBackground () {
        analytics.setEnabled(true);

        analytics.trackScreen("test_screen");

        // Make call to background
        analytics.onBackground(0);

        // Verify we started created an add event job
        verify(mockEventManager).addEvent(Mockito.argThat(new ArgumentMatcher<Event>() {
            @Override
            public boolean matches(Event argument) {
                return argument.getEventData().opt("screen").getString("").equals("test_screen");
            }
        }), Mockito.anyString());
    }
/**
     * Test that tracking event adds itself on background
     */
Test that tracking event adds itself on background
Test that tracking event adds itself on background
@Test
    public void testTrackingEventBackground () {
        analytics.setEnabled(true);
        analytics.trackScreen("test_screen");
        analytics.onBackground(0);
        verify(mockEventManager).addEvent(Mockito.argThat(new ArgumentMatcher<Event>() {
            @Override
            public boolean matches(Event argument) {
                return argument.getEventData().opt("screen").getString("").equals("test_screen");
            }
        }), Mockito.anyString());
    }
@ Test public void testTrackingEventBackground ( ) { analytics . setEnabled ( true ) ; analytics . trackScreen ( "test_screen" ) ; analytics . onBackground ( 0 ) ; verify ( mockEventManager ) . addEvent ( Mockito . argThat ( new ArgumentMatcher < Event > ( ) { @ Override public boolean matches ( Event argument ) { return argument . getEventData ( ) . opt ( "screen" ) . getString ( "" ) . equals ( "test_screen" ) ; } } ) , Mockito . anyString ( ) ) ; }
Test that tracking event adds itself on background
Test that tracking event adds itself on background
// Make call to background // Verify we started created an add event job