@Test
public void testCreateSecurityZone() throws Exception {

	RangerSecurityZone rangerSecurityZone = createRangerSecurityZone();
	XXServiceDao xServiceDao = Mockito.mock(XXServiceDao.class);
	XXService xService = Mockito.mock(XXService.class);
	XXServiceDefDao xServiceDefDao = Mockito.mock(XXServiceDefDao.class);
	when(rangerBizUtil.isAdmin()).thenReturn(true);
	when(daoManager.getXXService()).thenReturn(xServiceDao);
	when(xServiceDao.findByName("test_service_1")).thenReturn(xService);
	when(daoManager.getXXServiceDef()).thenReturn(xServiceDefDao);
	when(xServiceDefDao.getById(xService.getType())).thenReturn(xServiceDef);
	when(validatorFactory.getSecurityZoneValidator(svcStore, securityZoneStore)).thenReturn(validator);
	doNothing().when(validator).validate(rangerSecurityZone, RangerValidator.Action.CREATE);
	when(securityZoneStore.createSecurityZone(rangerSecurityZone)).thenReturn(rangerSecurityZone);
	RangerSecurityZone createdRangerSecurityZone = securityZoneREST.createSecurityZone(rangerSecurityZone);
	assertEquals(createdRangerSecurityZone.getName(), rangerSecurityZone.getName());
	verify(validator, times(1)).validate(rangerSecurityZone, RangerValidator.Action.CREATE);
}