urbanairship-core/src/test/java/com/urbanairship/push/IncomingPushRunnableTest.java
@Test
    @Config(sdk = 25)
    public void testDeliverPushSoundDisabled() {
        when(pushManager.isComponentEnabled()).thenReturn(true);
        when(pushManager.isPushEnabled()).thenReturn(true);
        when(pushManager.isOptIn()).thenReturn(true);
        when(pushManager.isUniqueCanonicalId("testPushID")).thenReturn(true);

        // Disable sound
        when(pushManager.isSoundEnabled()).thenReturn(false);

        notification.sound = Uri.parse("some://sound");
        notification.defaults = NotificationCompat.DEFAULT_ALL;

        pushRunnable.run();

        assertNull("The notification sound should be null.", notification.sound);
        assertEquals("The notification defaults should not include DEFAULT_SOUND.",
                notification.defaults & NotificationCompat.DEFAULT_SOUND, 0);
    }
/**
     * Test when sound is disabled the flag for DEFAULT_SOUND is removed and the notification sound
     * is set to null.
     */
Test when sound is disabled the flag for DEFAULT_SOUND is removed and the notification sound
is set to null.
Test when sound is disabled the flag for DEFAULT_SOUND is removed and the notification sound is set to null .
@Test
    @Config(sdk = 25)
    public void testDeliverPushSoundDisabled() {
        when(pushManager.isComponentEnabled()).thenReturn(true);
        when(pushManager.isPushEnabled()).thenReturn(true);
        when(pushManager.isOptIn()).thenReturn(true);
        when(pushManager.isUniqueCanonicalId("testPushID")).thenReturn(true);
        when(pushManager.isSoundEnabled()).thenReturn(false);
        notification.sound = Uri.parse("some://sound");
        notification.defaults = NotificationCompat.DEFAULT_ALL;
        pushRunnable.run();
        assertNull("The notification sound should be null.", notification.sound);
        assertEquals("The notification defaults should not include DEFAULT_SOUND.",
                notification.defaults & NotificationCompat.DEFAULT_SOUND, 0);
    }
@ Test @ Config ( sdk = 25 ) public void testDeliverPushSoundDisabled ( ) { when ( pushManager . isComponentEnabled ( ) ) . thenReturn ( true ) ; when ( pushManager . isPushEnabled ( ) ) . thenReturn ( true ) ; when ( pushManager . isOptIn ( ) ) . thenReturn ( true ) ; when ( pushManager . isUniqueCanonicalId ( "testPushID" ) ) . thenReturn ( true ) ; when ( pushManager . isSoundEnabled ( ) ) . thenReturn ( false ) ; notification . sound = Uri . parse ( "some://sound" ) ; notification . defaults = NotificationCompat . DEFAULT_ALL ; pushRunnable . run ( ) ; assertNull ( "The notification sound should be null." , notification . sound ) ; assertEquals ( "The notification defaults should not include DEFAULT_SOUND." , notification . defaults & NotificationCompat . DEFAULT_SOUND , 0 ) ; }
Test when sound is disabled the flag for DEFAULT_SOUND is removed and the notification sound
 is set to null.
Test when sound is disabled the flag for DEFAULT_SOUND is removed and the notification sound is set to null .
// Disable sound