urbanairship-core/src/test/java/com/urbanairship/actions/EnableFeatureActionTest.java
@Test
    public void testEnableBackgroundLocationPermissionDenied() {
        when(permissionsRequester.requestPermissions(any(Context.class), eq(Arrays.asList(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION))))
                .thenReturn(new int[] {PERMISSION_DENIED, PERMISSION_DENIED});

        ActionArguments args = ActionTestUtils.createArgs(Action.SITUATION_MANUAL_INVOCATION, EnableFeatureAction.FEATURE_BACKGROUND_LOCATION);
        ActionResult result = action.perform(args);
        verifyZeroInteractions(locationManager);
        assertFalse(result.getValue().getBoolean(true));
    }
/**
     * Test enabling {@link EnableFeatureAction#FEATURE_BACKGROUND_LOCATION} when the permission is denied.
     */
Test enabling  EnableFeatureAction#FEATURE_BACKGROUND_LOCATION when the permission is denied.
Test enabling EnableFeatureAction#FEATURE_BACKGROUND_LOCATION when the permission is denied .
@Test
    public void testEnableBackgroundLocationPermissionDenied() {
        when(permissionsRequester.requestPermissions(any(Context.class), eq(Arrays.asList(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION))))
                .thenReturn(new int[] {PERMISSION_DENIED, PERMISSION_DENIED});
        ActionArguments args = ActionTestUtils.createArgs(Action.SITUATION_MANUAL_INVOCATION, EnableFeatureAction.FEATURE_BACKGROUND_LOCATION);
        ActionResult result = action.perform(args);
        verifyZeroInteractions(locationManager);
        assertFalse(result.getValue().getBoolean(true));
    }
@ Test public void testEnableBackgroundLocationPermissionDenied ( ) { when ( permissionsRequester . requestPermissions ( any ( Context . class ) , eq ( Arrays . asList ( Manifest . permission . ACCESS_COARSE_LOCATION , Manifest . permission . ACCESS_FINE_LOCATION ) ) ) ) . thenReturn ( new int [ ] { PERMISSION_DENIED , PERMISSION_DENIED } ) ; ActionArguments args = ActionTestUtils . createArgs ( Action . SITUATION_MANUAL_INVOCATION , EnableFeatureAction . FEATURE_BACKGROUND_LOCATION ) ; ActionResult result = action . perform ( args ) ; verifyZeroInteractions ( locationManager ) ; assertFalse ( result . getValue ( ) . getBoolean ( true ) ) ; }
Test enabling {@link EnableFeatureAction#FEATURE_BACKGROUND_LOCATION} when the permission is denied.
Test enabling { @link EnableFeatureAction#FEATURE_BACKGROUND_LOCATION } when the permission is denied .