@Test
public void test5populateRangerResourceDefToXX() {

	RangerResourceDef rangerResourceDefObj = new RangerResourceDef();
	rangerResourceDefObj.setDescription("HDFS Repository");
	rangerResourceDefObj.setExcludesSupported(false);
	rangerResourceDefObj.setLabel("HDFS Repository");
	rangerResourceDefObj.setName("HDFs");
	XXResourceDef resourceDefObj = new XXResourceDef();
	resourceDefObj.setAddedByUserId(Id);
	resourceDefObj.setCreateTime(new Date());
	resourceDefObj.setDefid(Id);
	resourceDefObj.setDescription("HDFS Repository");
	resourceDefObj.setId(Id);
	XXServiceDef serviceDefObj = new XXServiceDef();
	serviceDefObj.setAddedByUserId(Id);
	serviceDefObj.setCreateTime(new Date());
	serviceDefObj.setDescription("HDFS Repository");
	serviceDefObj.setGuid("1427365526516_835_0");
	serviceDefObj.setId(Id);
	Mockito.when(
			(XXResourceDef) rangerAuditFields.populateAuditFields(
					resourceDefObj, serviceDefObj)).thenReturn(
			resourceDefObj);
	XXResourceDef dbResourceDef = rangerServiceDefService
			.populateRangerResourceDefToXX(rangerResourceDefObj,
					resourceDefObj, serviceDefObj, 1);
	Assert.assertNotNull(dbResourceDef);
	Assert.assertEquals(dbResourceDef, resourceDefObj);
	Assert.assertEquals(dbResourceDef.getId(), resourceDefObj.getId());
	Assert.assertEquals(dbResourceDef.getLabel(), resourceDefObj.getLabel());
	Assert.assertEquals(dbResourceDef.getName(), resourceDefObj.getName());
	Assert.assertEquals(dbResourceDef.getDescription(),
			resourceDefObj.getDescription());
}