@Test
public void test8createSecurityZoneWithExistingName() throws Exception {

	XXSecurityZone xxSecurityZone = new XXSecurityZone();
	xxSecurityZone.setId(2L);
	RangerSecurityZone securityZone = new RangerSecurityZone();
	RangerSecurityZone createdSecurityZone = new RangerSecurityZone();
	createdSecurityZone.setId(2L);
	XXSecurityZoneDao xXSecurityZoneDao = Mockito.mock(XXSecurityZoneDao.class);
	Mockito.when(daoManager.getXXSecurityZoneDao()).thenReturn(xXSecurityZoneDao);
	Mockito.when(xXSecurityZoneDao.findByZoneName(securityZone.getName())).thenReturn(xxSecurityZone);
	Mockito.when(restErrorUtil.createRESTException(Mockito.anyString(), Mockito.any(MessageEnums.class)))
			.thenThrow(new WebApplicationException());
	thrown.expect(WebApplicationException.class);
	securityZoneDBStore.createSecurityZone(securityZone);
	Mockito.verify(daoManager, times(1)).getXXSecurityZoneDao();
	Mockito.verify(xXSecurityZoneDao, times(1)).findByZoneName(securityZone.getName());
}