urbanairship-core/src/test/java/com/urbanairship/analytics/AnalyticsTest.java
@Test
    public void testAddEventDisabledAnalyticsConfig() {
        AirshipConfigOptions options = new AirshipConfigOptions.Builder()
                .setDevelopmentAppKey("appKey")
                .setDevelopmentAppSecret("appSecret")
                .setAnalyticsEnabled(false)
                .build();

        this.analytics = new Analytics.Builder(TestApplication.getApplication())
                .setActivityMonitor(new TestActivityMonitor())
                .setConfigOptions(options)
                .setJobDispatcher(mockJobDispatcher)
                .setPlatform(UAirship.ANDROID_PLATFORM)
                .setPreferenceDataStore(TestApplication.getApplication().preferenceDataStore)
                .setEventManager(mockEventManager)
                .build();

        analytics.addEvent(new AppForegroundEvent(100));
        verifyZeroInteractions(mockEventManager);
    }
/**
     * Test adding an event when analytics is disabled through airship config.
     */
Test adding an event when analytics is disabled through airship config.
Test adding an event when analytics is disabled through airship config .
@Test
    public void testAddEventDisabledAnalyticsConfig() {
        AirshipConfigOptions options = new AirshipConfigOptions.Builder()
                .setDevelopmentAppKey("appKey")
                .setDevelopmentAppSecret("appSecret")
                .setAnalyticsEnabled(false)
                .build();
        this.analytics = new Analytics.Builder(TestApplication.getApplication())
                .setActivityMonitor(new TestActivityMonitor())
                .setConfigOptions(options)
                .setJobDispatcher(mockJobDispatcher)
                .setPlatform(UAirship.ANDROID_PLATFORM)
                .setPreferenceDataStore(TestApplication.getApplication().preferenceDataStore)
                .setEventManager(mockEventManager)
                .build();
        analytics.addEvent(new AppForegroundEvent(100));
        verifyZeroInteractions(mockEventManager);
    }
@ Test public void testAddEventDisabledAnalyticsConfig ( ) { AirshipConfigOptions options = new AirshipConfigOptions . Builder ( ) . setDevelopmentAppKey ( "appKey" ) . setDevelopmentAppSecret ( "appSecret" ) . setAnalyticsEnabled ( false ) . build ( ) ; this . analytics = new Analytics . Builder ( TestApplication . getApplication ( ) ) . setActivityMonitor ( new TestActivityMonitor ( ) ) . setConfigOptions ( options ) . setJobDispatcher ( mockJobDispatcher ) . setPlatform ( UAirship . ANDROID_PLATFORM ) . setPreferenceDataStore ( TestApplication . getApplication ( ) . preferenceDataStore ) . setEventManager ( mockEventManager ) . build ( ) ; analytics . addEvent ( new AppForegroundEvent ( 100 ) ) ; verifyZeroInteractions ( mockEventManager ) ; }
Test adding an event when analytics is disabled through airship config.
Test adding an event when analytics is disabled through airship config .