@Test
public void test7populateRangerAccessTypeDefToXX() {

	RangerAccessTypeDef rangerAccessTypeDefObj = new RangerAccessTypeDef();
	rangerAccessTypeDefObj.setLabel("Read");
	rangerAccessTypeDefObj.setName("read");
	rangerAccessTypeDefObj.setRbKeyLabel(null);
	XXAccessTypeDef accessTypeDefObj = new XXAccessTypeDef();
	accessTypeDefObj.setAddedByUserId(Id);
	accessTypeDefObj.setCreateTime(new Date());
	accessTypeDefObj.setDefid(Id);
	accessTypeDefObj.setId(Id);
	accessTypeDefObj.setLabel("Read");
	accessTypeDefObj.setName("read");
	accessTypeDefObj.setOrder(null);
	accessTypeDefObj.setRbkeylabel(null);
	accessTypeDefObj.setUpdatedByUserId(Id);
	accessTypeDefObj.setUpdateTime(new Date());
	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(
			(XXAccessTypeDef) rangerAuditFields.populateAuditFields(
					accessTypeDefObj, serviceDefObj)).thenReturn(
			accessTypeDefObj);
	XXAccessTypeDef dbAccessTypeDef = rangerServiceDefService
			.populateRangerAccessTypeDefToXX(rangerAccessTypeDefObj,
					accessTypeDefObj, serviceDefObj, 1);
	Assert.assertNotNull(dbAccessTypeDef);
	Assert.assertEquals(dbAccessTypeDef, accessTypeDefObj);
	Assert.assertEquals(dbAccessTypeDef.getName(),
			accessTypeDefObj.getName());
	Assert.assertEquals(dbAccessTypeDef.getLabel(),
			accessTypeDefObj.getLabel());
	Assert.assertEquals(dbAccessTypeDef.getRbkeylabel(),
			accessTypeDefObj.getRbkeylabel());
	Assert.assertEquals(dbAccessTypeDef.getDefid(),
			accessTypeDefObj.getDefid());
	Assert.assertEquals(dbAccessTypeDef.getId(), accessTypeDefObj.getId());
	Assert.assertEquals(dbAccessTypeDef.getCreateTime(),
			accessTypeDefObj.getCreateTime());
	Assert.assertEquals(dbAccessTypeDef.getOrder(),
			accessTypeDefObj.getOrder());
}