urbanairship-core/src/test/java/com/urbanairship/analytics/AnalyticsTest.java
@Test
    public void testOnBackground() {
        // Start analytics in the foreground
        analytics.setConversionSendId("some-id");

        analytics.onBackground(0);

        // Verify that we clear the conversion send id
        assertNull("App background should clear the conversion send id", analytics.getConversionSendId());

        // Verify that a job to add a background event is dispatched
        verify(mockEventManager).addEvent(Mockito.any(AppBackgroundEvent.class), Mockito.anyString());
    }
/**
     * Test that when the app goes into the background, the conversion send id is
     * cleared, a background event is sent to be added, and a broadcast for background
     * is sent.
     */
Test that when the app goes into the background, the conversion send id is
cleared, a background event is sent to be added, and a broadcast for background
is sent.
Test that when the app goes into the background the conversion send id is cleared a background event is sent to be added and a broadcast for background is sent .
@Test
    public void testOnBackground() {
        analytics.setConversionSendId("some-id");
        analytics.onBackground(0);
        assertNull("App background should clear the conversion send id", analytics.getConversionSendId());
        verify(mockEventManager).addEvent(Mockito.any(AppBackgroundEvent.class), Mockito.anyString());
    }
@ Test public void testOnBackground ( ) { analytics . setConversionSendId ( "some-id" ) ; analytics . onBackground ( 0 ) ; assertNull ( "App background should clear the conversion send id" , analytics . getConversionSendId ( ) ) ; verify ( mockEventManager ) . addEvent ( Mockito . any ( AppBackgroundEvent . class ) , Mockito . anyString ( ) ) ; }
Test that when the app goes into the background, the conversion send id is
 cleared, a background event is sent to be added, and a broadcast for background
 is sent.
Test that when the app goes into the background the conversion send id is cleared a background event is sent to be added and a broadcast for background is sent .
// Start analytics in the foreground // Verify that we clear the conversion send id // Verify that a job to add a background event is dispatched