@Test
public void test4getServiceDefById() throws Exception {

	RangerServiceDef rangerServiceDef = rangerServiceDef();
	XXServiceDef xServiceDef = serviceDef();
	XXServiceDefDao xServiceDefDao = Mockito.mock(XXServiceDefDao.class);
	Mockito.when(daoManager.getXXServiceDef()).thenReturn(xServiceDefDao);
	Mockito.when(xServiceDefDao.getById(Id)).thenReturn(xServiceDef);
	Mockito.when(!bizUtil.hasAccess(xServiceDef, null)).thenReturn(true);
	Mockito.when(svcStore.getServiceDef(rangerServiceDef.getId()))
			.thenReturn(rangerServiceDef);
	RangerServiceDef dbRangerServiceDef = serviceREST
			.getServiceDef(rangerServiceDef.getId());
	Assert.assertNotNull(dbRangerServiceDef);
	Assert.assertEquals(dbRangerServiceDef.getId(),
			rangerServiceDef.getId());
	Mockito.verify(svcStore).getServiceDef(rangerServiceDef.getId());
	Mockito.verify(daoManager).getXXServiceDef();
	Mockito.verify(bizUtil).hasAccess(xServiceDef, null);
}