AvailableColumnsController extends InterMineAction { @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); String queryXML = (String) request.getAttribute("queryXML"); String table = (String) request.getAttribute("table"); @SuppressWarnings("deprecation") PathQuery q = (queryXML != null) ? PathQueryBinding.unmarshalPathQuery( new StringReader(queryXML), PathQuery.USERPROFILE_VERSION) : SessionMethods.getResultsTable(session, table).getWebTable() .getPathQuery(); request.setAttribute("availableColumns", getColumnsThatCanBeAdded(q)); return null; }  @Override ActionForward execute(ActionMapping mapping,
            ActionForm form, HttpServletRequest request,
            HttpServletResponse response);  }
@Test public void testExecute() throws Exception { HttpServletRequest request = createMock(HttpServletRequest.class); Map<String, String> expectedColumns = new HashMap<String, String>(); expectedColumns.put("Employee.fullTime", "Employee&nbsp;&gt; fullTime"); expectedColumns.put("Employee.age", "Employee&nbsp;&gt; age"); expectedColumns.put("Employee.end", "Employee&nbsp;&gt; end"); HttpSession session = null; expect(request.getSession()).andReturn(session); expect(request.getAttribute("queryXML")).andReturn(QUERY_XML); expect(request.getAttribute("table")).andReturn("FOO"); request.setAttribute("availableColumns", expectedColumns); replay(request); ActionForward fwd = controller.execute(null, null, request, null); assertNull(fwd); verify(request); }