AddParentsController extends AbstractCommandController { public TargetEditorContext getEditorContext(HttpServletRequest req) { TargetEditorContext ctx = (TargetEditorContext) req.getSession().getAttribute(TabbedTargetController.EDITOR_CONTEXT); if( ctx == null) { throw new IllegalStateException("tabEditorContext not yet bound to the session"); } return ctx; } AddParentsController(); TargetEditorContext getEditorContext(HttpServletRequest req); void setTargetController(TabbedTargetController targetController); void setTargetManager(TargetManager targetManager); void setAuthorityManager(AuthorityManager authorityManager); void setSubGroupSeparator(String subGroupSeparator);  }
@Test public final void testGetEditorContext() { try { HttpServletRequest aReq = new MockHttpServletRequest(); TargetEditorContext targetEditorContext = bindEditorContext(aReq); TargetEditorContext tec = testInstance.getEditorContext(aReq); assertNotNull(tec); assertEquals(targetEditorContext, tec); } catch(Exception e) { fail(e.getMessage()); } }