@Test
public void test5getServiceDefByName() throws Exception {

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