TargetSeedsHandler extends AbstractTargetTabHandler { public ModelAndView processLinkSearch(TabbedController tc, Target aTarget, SeedsCommand command, boolean doSearch, BindException errors) { TabbedModelAndView tmav = getSeedLinkTabModel(tc); tmav.addObject(Constants.GBL_CMD_DATA, command); if(doSearch) { Pagination results = null; if(SeedsCommand.SEARCH_SITES.equals(command.getSearchType())) { results = targetManager.findPermissionsBySiteTitle(aTarget, command.getSiteSearchCriteria(), command.getPageNumber()); } else { results = targetManager.findPermissionsByUrl(aTarget, command.getUrlSearchCriteria(), command.getPageNumber()); } tmav.addObject("results", results); } tmav.addObject(Constants.GBL_ERRORS, errors); return tmav; }  @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void processTab(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); TabbedModelAndView preProcessNextTab(TabbedController tc,
			Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
			Object comm, BindException errors); ModelAndView processOther(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); ModelAndView processLinkSearch(TabbedController tc, Target aTarget, SeedsCommand command, boolean doSearch, BindException errors); void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory); void setTargetManager(TargetManager targetManager); void setValidator(TargetSeedsValidator validator); void setAuthorityManager(AuthorityManager authorityManager); void setMessageSource(MessageSource messageSource);  }
@Test public final void testProcessLinkSearch() { HttpServletRequest aReq = new MockHttpServletRequest(); TargetManager targetManager = new MockTargetManager(testFile); testInstance.setTargetManager(targetManager); testSetBusinessObjectFactory(); testSetValidator(); testSetAuthorityManager(); testSetMessageSource(); Target target = targetManager.load(4000L); TargetEditorContext targetEditorContext = new TargetEditorContext(targetManager,target,true); aReq.getSession().setAttribute(TabbedTargetController.EDITOR_CONTEXT, targetEditorContext); SeedsCommand aCmd = new SeedsCommand(); TabbedController tc = new TabbedTargetController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("target"); List<Tab> tabs = getTabList(targetManager); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); tc.setDefaultCommandClass(org.webcurator.ui.target.command.TargetDefaultCommand.class); BindException aErrors = new BindException(aCmd, "SeedsCommand"); PermissionMappingStrategy.setStrategy(new HierarchicalPermissionMappingStrategy()); aCmd.setUrlSearchCriteria("www.oakleigh.co.uk/*"); ModelAndView mav = testInstance.processLinkSearch(tc, target, aCmd, false, aErrors); assertNotNull(mav); }