@Test
public void test52deleteService() throws Exception {

	RangerService rangerService = rangerService();
	XXService xService = xService();
	List<XXService> referringServices = new ArrayList<XXService>();
	referringServices.add(xService);
	EmbeddedServiceDefsUtil embeddedServiceDefsUtil = EmbeddedServiceDefsUtil.instance();
	xService.setType(embeddedServiceDefsUtil.getTagServiceDefId());
	XXServiceDao xServiceDao = Mockito.mock(XXServiceDao.class);
	String userLoginID = "testuser";
	Long userId = 8L;
	RangerSecurityContext context = new RangerSecurityContext();
	context.setUserSession(new UserSessionBase());
	RangerContextHolder.setSecurityContext(context);
	UserSessionBase session = ContextUtil.getCurrentUserSession();
	session.setUserAdmin(true);
	XXPortalUser xXPortalUser = new XXPortalUser();
	xXPortalUser.setLoginId(userLoginID);
	xXPortalUser.setId(userId);
	session.setXXPortalUser(xXPortalUser);
	Mockito.when(validatorFactory.getServiceValidator(svcStore)).thenReturn(serviceValidator);
	Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
	Mockito.when(xServiceDao.findByTagServiceId(Mockito.anyLong())).thenReturn(referringServices);
	Mockito.when(xServiceDao.getById(Id)).thenReturn(xService);
	Mockito.when(restErrorUtil.createRESTException(Mockito.anyString(), (MessageEnums) Mockito.any()))
			.thenThrow(new WebApplicationException());
	thrown.expect(WebApplicationException.class);
	serviceREST.deleteService(rangerService.getId());
}