XPermMapService extends XPermMapServiceBase<XXPermMap, VXPermMap> { public List<XXTrxLog> getTransactionLog(VXPermMap vXPermMap, String action){ return getTransactionLog(vXPermMap, null, action); } XPermMapService(); @Override VXPermMap populateViewBean(XXPermMap xXPermMap); String getGroupName(Long groupId); String getUserName(Long userId); List<XXTrxLog> getTransactionLog(VXPermMap vXPermMap, String action); List<XXTrxLog> getTransactionLog(VXPermMap vObj, VXPermMap mObj, String action);  }
@Test public void test3GetTransactionLog() { VXPermMap vXPermMap = createVXPermMap(); Mockito.when(daoManager.getXXGroup()).thenReturn(xXGroupDao); XXGroup xGroup = createXXGroup(); Mockito.when(xXGroupDao.getById(1L)).thenReturn(xGroup); Mockito.when(daoManager.getXXResource()).thenReturn(xXResourceDao); Mockito.when(xXResourceDao.getById(vXPermMap.getId())).thenReturn(xXResource); Mockito.when(xXResource.getAssetId()).thenReturn(1L); Mockito.when(daoManager.getXXAsset()).thenReturn(xXAssetDao); Mockito.when(xXAssetDao.getById(1L)).thenReturn(xXAsset); xPermMapService.getTransactionLog(vXPermMap, "create"); }
@Test public void test4GetTransactionLog() { VXPermMap vObj = createVXPermMap(); Mockito.when(daoManager.getXXGroup()).thenReturn(xXGroupDao); XXGroup xGroup = createXXGroup(); Mockito.when(xXGroupDao.getById(1L)).thenReturn(xGroup); Mockito.when(daoManager.getXXResource()).thenReturn(xXResourceDao); Mockito.when(xXResourceDao.getById(vObj.getId())).thenReturn(xXResource); Mockito.when(xXResource.getAssetId()).thenReturn(1L); Mockito.when(daoManager.getXXAsset()).thenReturn(xXAssetDao); Mockito.when(xXAssetDao.getById(1L)).thenReturn(xXAsset); xPermMapService.getTransactionLog(vObj, vObj, "update"); }