TargetInstanceProfileHandler extends AbstractOverrideTabHandler { @Override public ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TargetInstanceProfileCommand command = (TargetInstanceProfileCommand) comm; TargetInstance ti = (TargetInstance) req.getSession().getAttribute(TargetInstanceCommand.SESSION_TI); if(command.getActionCmd().equals("toggleOverride")) { if(command.isOverrideTarget()) { ti.setOverrides(ti.getTarget().getOverrides().copy()); } else { ti.setOverrides(null); } TabbedModelAndView tmav = preProcessNextTab(tc, currentTab, req, res, comm, errors); tmav.getTabStatus().setCurrentTab(currentTab); return tmav; } else { return super.processOther(tc, currentTab, req, res, comm, errors); } }  @Override TabbedModelAndView preProcessNextTab(TabbedController tc,
			Tab nextTabID, HttpServletRequest req, HttpServletResponse res,
			Object comm, BindException errors); @Override void processTab(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); @Override ModelAndView processOther(TabbedController tc, Tab currentTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors);  }
@Test public final void testProcessOther() { HttpServletRequest aReq = new MockHttpServletRequest(); TargetInstance targetInstance = getTargetInstanceManager().getTargetInstance(5001L); ProfileOverrides po = getProfileOverrides(20000L); targetInstance.setOverrides(po); aReq.getSession().setAttribute(TargetInstanceCommand.SESSION_TI, targetInstance); aReq.getSession().setAttribute(TargetInstanceCommand.SESSION_MODE, true); HttpServletResponse aResp = new MockHttpServletResponse(); TargetInstanceProfileCommand aCmd = new TargetInstanceProfileCommand(); TabbedController tc = new TabbedTargetInstanceController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("targetInstance"); List<Tab> tabs = getTabList(); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); tc.setDefaultCommandClass(org.webcurator.ui.target.command.TargetInstanceCommand.class); Tab currentTab = tabs.get(1); aCmd.setActionCmd("toggleOverride"); BindException aErrors = new BindException(aCmd, aCmd.getActionCmd()); ModelAndView mav = testInstance.processOther(tc, currentTab, aReq, aResp, aCmd, aErrors); assertTrue(mav != null); }