@Test
public void test9populateXXToRangerAccessTypeDef() {

	XXAccessTypeDefGrantsDao xAccessTypeDefGrantsDao = Mockito
			.mock(XXAccessTypeDefGrantsDao.class);
	List<String> lists = new ArrayList<String>();
	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());
	Mockito.when(daoManager.getXXAccessTypeDefGrants()).thenReturn(
			xAccessTypeDefGrantsDao);
	Mockito.when(
			xAccessTypeDefGrantsDao
					.findImpliedGrantsByATDId(accessTypeDefObj.getId()))
			.thenReturn(lists);
	RangerAccessTypeDef dbRangerAccessTypeDef = rangerServiceDefService
			.populateXXToRangerAccessTypeDef(accessTypeDefObj);
	Assert.assertNotNull(dbRangerAccessTypeDef);
	Assert.assertEquals(dbRangerAccessTypeDef.getName(),
			accessTypeDefObj.getName());
	Assert.assertEquals(dbRangerAccessTypeDef.getLabel(),
			accessTypeDefObj.getLabel());
	Assert.assertEquals(dbRangerAccessTypeDef.getRbKeyLabel(),
			accessTypeDefObj.getRbkeylabel());
}