@Test
public void test_getValidationRegExes() {

	// passing in null service def
	Map<String, String> regExMap = _validator.getValidationRegExes((RangerServiceDef)null);
	Assert.assertTrue(regExMap.isEmpty());
	// that has null or empty access type def
	RangerServiceDef serviceDef = mock(RangerServiceDef.class);
	when(serviceDef.getResources()).thenReturn(null);
	regExMap = _validator.getValidationRegExes(serviceDef);
	Assert.assertTrue(regExMap.isEmpty());
	List<RangerResourceDef> resourceDefs = new ArrayList<>();
	when(serviceDef.getResources()).thenReturn(resourceDefs);
	regExMap = _validator.getValidationRegExes(serviceDef);
	Assert.assertTrue(regExMap.isEmpty());
	
	// having null accesstypedefs
	resourceDefs.add(null);
	regExMap = _validator.getValidationRegExes(serviceDef);
	Assert.assertTrue(regExMap.isEmpty());
	
	// access type defs with null empty blank names are skipped, spaces within names are preserved
	String[][] data = {
			{ "a", null },     // null-regex
			null,              // this should put a null element in the resource def!
			{ "b", "regex1" }, // valid
			{ "c", "" },       // empty regex
			{ "d", "regex2" }, // valid
			{ "e", "   " },    // blank regex
			{ "f", "regex3" }, // all good
	};
	resourceDefs.addAll(_utils.createResourceDefsWithRegEx(data));
	regExMap = _validator.getValidationRegExes(serviceDef);
	Assert.assertEquals(3, regExMap.size());
	Assert.assertEquals("regex1", regExMap.get("b"));
	Assert.assertEquals("regex2", regExMap.get("d"));
	Assert.assertEquals("regex3", regExMap.get("f"));
}