RangerTagResourceMapService extends RangerTagResourceMapServiceBase<XXTagResourceMap, RangerTagResourceMap> { public List<RangerTagResourceMap> getByTagGuid(String tagGuid) { List<RangerTagResourceMap> ret = new ArrayList<RangerTagResourceMap>(); List<XXTagResourceMap> xxTagResourceMaps = daoMgr.getXXTagResourceMap().findByTagGuid(tagGuid); if(CollectionUtils.isNotEmpty(xxTagResourceMaps)) { for(XXTagResourceMap xxTagResourceMap : xxTagResourceMaps) { RangerTagResourceMap tagResourceMap = populateViewBean(xxTagResourceMap); ret.add(tagResourceMap); } } return ret; } RangerTagResourceMapService(); @Override RangerTagResourceMap postCreate(XXTagResourceMap tagResMap); RangerTagResourceMap getPopulatedViewObject(XXTagResourceMap xObj); List<RangerTagResourceMap> getByTagId(Long tagId); List<RangerTagResourceMap> getByTagGuid(String tagGuid); List<RangerTagResourceMap> getByResourceId(Long resourceId); List<Long> getTagIdsForResourceId(Long resourceId); List<RangerTagResourceMap> getByResourceGuid(String resourceGuid); RangerTagResourceMap getByGuid(String guid); RangerTagResourceMap getByTagAndResourceId(Long tagId, Long resourceId); RangerTagResourceMap getByTagAndResourceGuid(String tagGuid, String resourceGuid); List<RangerTagResourceMap> getTagResourceMapsByServiceId(Long serviceId);  }
@Test public void test5GetByTagGuid() { Mockito.when(daoMgr.getXXTagResourceMap()).thenReturn(xXTagResourceMapDao); rangerTagResourceMapService.getByTagGuid("1"); }