@Test
public final void test_isValidResourceNames_failures() {

	String serviceName = "a-service-def";
	// setup service-def
	Date now = new Date();
	when(_serviceDef.getName()).thenReturn(serviceName );
	when(_serviceDef.getUpdateTime()).thenReturn(now);
	List<RangerResourceDef> resourceDefs = _utils.createResourceDefs(resourceDefData_multipleHierarchies);
	when(_serviceDef.getResources()).thenReturn(resourceDefs);
	// setup policy
	Map<String, RangerPolicyResource> policyResources = _utils.createPolicyResourceMap(policyResourceMap_bad);
	when(_policy.getResources()).thenReturn(policyResources);
	Assert.assertFalse("Missing required resource and unknown resource", _validator.isValidResourceNames(_policy, _failures, _serviceDef));
	_utils.checkFailureForSemanticError(_failures, "policy resources");
	// another bad resource map that straddles multiple hierarchies
	policyResources = _utils.createPolicyResourceMap(policyResourceMap_bad_multiple_hierarchies);
	when(_policy.getResources()).thenReturn(policyResources);
	_failures.clear(); Assert.assertFalse("Policy with resources for multiple hierarchies", _validator.isValidResourceNames(_policy, _failures, _serviceDef));
	_utils.checkFailureForSemanticError(_failures, "policy resources", "incompatible");
	// another bad policy resource map that could match multiple hierarchies but is short on mandatory resources for all of those matches
	policyResources = _utils.createPolicyResourceMap(policyResourceMap_bad_multiple_hierarchies_missing_mandatory);
	when(_policy.getResources()).thenReturn(policyResources);
	_failures.clear(); Assert.assertFalse("Policy with resources for multiple hierarchies missing mandatory resources for all pontential matches", _validator.isValidResourceNames(_policy, _failures, _serviceDef));
	_utils.checkFailureForSemanticError(_failures, "policy resources", "missing mandatory");
}