@Test
public void test58getSecureServicePoliciesIfUpdatedAllowedFail() throws Exception {

	HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
	Long lastKnownVersion = 1L;
	String pluginId = "1";
	XXService xService = xService();
	XXServiceDef xServiceDef = serviceDef();
	xServiceDef.setImplclassname("org.apache.ranger.services.kms.RangerServiceKMS");
	String serviceName = xService.getName();
	RangerService rs = rangerService();
	XXServiceDefDao xServiceDefDao = Mockito.mock(XXServiceDefDao.class);
	Mockito.when(serviceUtil.isValidService(serviceName, request)).thenReturn(true);
	Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
	Mockito.when(xServiceDao.findByName(serviceName)).thenReturn(xService);
	Mockito.when(daoManager.getXXServiceDef()).thenReturn(xServiceDefDao);
	Mockito.when(xServiceDefDao.getById(xService.getType())).thenReturn(xServiceDef);
	Mockito.when(svcStore.getServiceByNameForDP(serviceName)).thenReturn(rs);
	Mockito.when(bizUtil.isUserAllowed(rs, ServiceREST.Allowed_User_List_For_Grant_Revoke)).thenReturn(true);
	Mockito.when(restErrorUtil.createRESTException(Mockito.anyInt(), Mockito.anyString(), Mockito.anyBoolean()))
			.thenThrow(new WebApplicationException());
	thrown.expect(WebApplicationException.class);
	serviceREST.getSecureServicePoliciesIfUpdated(serviceName, lastKnownVersion, 0L, pluginId, "", "", false, capabilityVector, request);
}