@Test
public final void testIsValid_long() throws Exception {

	// this validation should be removed if we start supporting other than delete action
	Assert.assertFalse(_validator.isValid(3L, Action.CREATE, _failures));
	_utils.checkFailureForInternalError(_failures);
	
	// should fail with appropriate error message if id is null
	_failures.clear(); _failures.clear(); Assert.assertFalse(_validator.isValid((Long)null, Action.DELETE, _failures));
	_utils.checkFailureForMissingValue(_failures, "id");
	
	// should not fail if policy can't be found for the specified id
	when(_store.getPolicy(1L)).thenReturn(null);
	when(_store.getPolicy(2L)).thenThrow(new Exception());
	RangerPolicy existingPolicy = mock(RangerPolicy.class);
	when(_store.getPolicy(3L)).thenReturn(existingPolicy);
	_failures.clear(); Assert.assertTrue(_validator.isValid(1L, Action.DELETE, _failures));
	Assert.assertTrue(_failures.isEmpty());
	_failures.clear(); Assert.assertTrue(_validator.isValid(2L, Action.DELETE, _failures));
	Assert.assertTrue(_failures.isEmpty());
	// if policy exists then delete validation should pass, too!
	_failures.clear(); Assert.assertTrue(_validator.isValid(3L, Action.DELETE, _failures));
	Assert.assertTrue(_failures.isEmpty());
}