@Test
public final void test_isValidResources() {

	// null/empty resources are an error
	when(_serviceDef.getResources()).thenReturn(null);
	_failures.clear(); assertFalse(_validator.isValidResources(_serviceDef, _failures, Action.CREATE));
	_utils.checkFailureForMissingValue(_failures, "resources");
	
	List<RangerResourceDef> resources = new ArrayList<>();
	when(_serviceDef.getResources()).thenReturn(resources);
	_failures.clear(); assertFalse(_validator.isValidResources(_serviceDef, _failures, Action.CREATE));
	_utils.checkFailureForMissingValue(_failures, "resources");
	
	resources.addAll(_utils.createResourceDefsWithIds(invalidResources));
	_failures.clear(); assertFalse(_validator.isValidResources(_serviceDef, _failures, Action.CREATE));
	_utils.checkFailureForMissingValue(_failures, "resource name");
	_utils.checkFailureForMissingValue(_failures, "resource itemId");
	_utils.checkFailureForSemanticError(_failures, "resource itemId", "1"); // id 1 is duplicate
	_utils.checkFailureForSemanticError(_failures, "resource name", "DataBase");
	resources.clear(); resources.addAll(_utils.createResourceDefsWithIds(mixedCaseResources));
	_failures.clear(); assertFalse(_validator.isValidResources(_serviceDef, _failures, Action.CREATE));
	_utils.checkFailure(_failures, null, null, null, "DBase",null);
	_utils.checkFailure(_failures, null, null, null, "TABLE",null);
	_utils.checkFailure(_failures, null, null, null, "Column",null);
}