@Test
public void test8createPolicy() throws Exception {

	RangerPolicy policy = rangerPolicy();
	RangerService service = rangerService();
	VXPolicy vXPolicy = vXPolicy(policy, service);
	Mockito.when(serviceREST.getServiceByName(vXPolicy.getRepositoryName())).thenReturn(service);
	Mockito.when(serviceUtil.toRangerPolicy(vXPolicy,service)).thenReturn(policy);
	Mockito.when(serviceREST.createPolicy(policy, null)).thenReturn(policy);
	Mockito.when(serviceUtil.toVXPolicy(policy, service)).thenReturn(vXPolicy);
	VXPolicy dbVXPolicy = publicAPIs.createPolicy(vXPolicy);
	Assert.assertNotNull(dbVXPolicy);
	Assert.assertEquals(dbVXPolicy, vXPolicy);
	Assert.assertEquals(dbVXPolicy.getId(),
			vXPolicy.getId());
	Assert.assertEquals(dbVXPolicy.getRepositoryName(),
			vXPolicy.getRepositoryName());
	Mockito.verify(serviceREST).createPolicy(policy, null);
	Mockito.verify(serviceREST).getServiceByName(vXPolicy.getRepositoryName());
	Mockito.verify(serviceUtil).toVXPolicy(policy, service);
	Mockito.verify(serviceUtil).toRangerPolicy(vXPolicy,service);
	
}