@Test
public void testGetResourceJSON() {

	RangerService rangerService = rangerService(Id);
	String file = "testGetResourceJSON";
	VXAsset vXAsset = vXAsset(Id);
	Date date = new Date();
	String strdt = date.toString();
	X509Certificate[] certchain = new X509Certificate[1];
	certchain[0] = Mockito.mock(X509Certificate.class);
	ServicePolicies servicePolicies = servicePolicies();
	RangerPolicy rangerPolicy = rangerPolicy(Id);
	List<RangerPolicy> policies = new ArrayList<RangerPolicy>();
	policies.add(rangerPolicy);
	Mockito.when(request.getParameter("epoch")).thenReturn(strdt);
	Mockito.when(request.getAttribute("javax.servlet.request.X509Certificate")).thenReturn(certchain);
	Mockito.when(request.getHeader("X-FORWARDED-FOR")).thenReturn("valid");
	Mockito.when(request.isSecure()).thenReturn(true);
	Mockito.when(request.getParameter("policyCount")).thenReturn("4");
	Mockito.when(request.getParameter("agentId")).thenReturn("12");
	// Mockito.when(PropertiesUtil.getBooleanProperty("ranger.service.http.enabled",true)).thenReturn(true);
	try {
		Mockito.when(serviceREST.getServicePoliciesIfUpdated(Mockito.anyString(), Mockito.anyLong(),
				Mockito.anyLong(), Mockito.anyString(), Mockito.anyString() , Mockito.anyString() , Mockito.anyBoolean(), Mockito.anyString(), (HttpServletRequest) Mockito.any()))
				.thenReturn(servicePolicies);
	} catch (Exception e) {
		fail("test failed due to: " + e.getMessage());
	}
	Mockito.when(serviceUtil.getServiceByName("hdfs_dev")).thenReturn(rangerService);
	Mockito.when(serviceUtil.toVXAsset(rangerService)).thenReturn(vXAsset);
	Mockito.when(assetMgr.getLatestRepoPolicy((VXAsset) Mockito.any(), Mockito.<VXResource>anyList(), Mockito.anyLong(),
			(X509Certificate[]) Mockito.any(), Mockito.anyBoolean(), Mockito.anyString(), Mockito.anyString(),
			Mockito.anyBoolean(), Mockito.anyString(), Mockito.anyString())).thenReturn(file);
	String actualFile = assetREST.getResourceJSON(request, "hdfs_dev");
	Assert.assertEquals(file, actualFile);
	Mockito.verify(serviceUtil).getServiceByName("hdfs_dev");
	Mockito.verify(serviceUtil).toVXAsset(rangerService);
	Mockito.verify(request).getParameter("epoch");
	Mockito.verify(request).getAttribute("javax.servlet.request.X509Certificate");
	Mockito.verify(request).getHeader("X-FORWARDED-FOR");
	Mockito.verify(request).isSecure();
	Mockito.verify(request).getParameter("policyCount");
	Mockito.verify(request).getParameter("agentId");
	Mockito.verify(assetMgr).getLatestRepoPolicy((VXAsset) Mockito.any(), Mockito.<VXResource>anyList(),
			Mockito.anyLong(), (X509Certificate[]) Mockito.any(), Mockito.anyBoolean(), Mockito.anyString(),
			Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyString(), Mockito.anyString());
}