@Test
public void testGrantPermissionWebApplicationException() {

	RangerPolicy policy = rangerPolicy(Id);
	RangerService service = rangerService(Id);
	VXPolicy vXPolicy = vXPolicy(policy, service);
	GrantRevokeRequest grantRequestObj = new GrantRevokeRequest();
	grantRequestObj.setAccessTypes(null);
	grantRequestObj.setDelegateAdmin(true);
	grantRequestObj.setEnableAudit(true);
	grantRequestObj.setGrantor("read");
	grantRequestObj.setIsRecursive(true);
	WebApplicationException webApplicationException = new WebApplicationException();
	Mockito.when(serviceUtil.toGrantRevokeRequest(vXPolicy)).thenReturn(grantRequestObj);
	try {
		Mockito.when(serviceREST.grantAccess(vXPolicy.getRepositoryName(), grantRequestObj, request))
				.thenThrow(webApplicationException);
	} catch (Exception e) {
		fail("test failed due to: " + e.getMessage());
	}
	try {
		assetREST.grantPermission(request, vXPolicy);
		fail("Exception not thrown");
	} catch (WebApplicationException e) {
		Assert.assertTrue(true);
	}
	Mockito.verify(serviceUtil).toGrantRevokeRequest(vXPolicy);
	try {
		Mockito.verify(serviceREST).grantAccess(vXPolicy.getRepositoryName(), grantRequestObj, request);
	} catch (Exception e) {
		fail("test failed due to: " + e.getMessage());
	}
}