HttpServletResponse response = createMock(HttpServletResponse.class);
Middleman middleman = createMock(Middleman.class);
expect(request.getParameter("url")).andReturn(null).anyTimes();
expect(request.getParameter("regex")).andReturn(".*tags=foo.*").anyTimes();
expect(middleman.addRefreshRule(".*tags=foo.*")).andReturn(Collections.singleton(new Rule(".*tags=foo.*")));
Refresher r = new Refresher();
r.setMiddleman(middleman);
replay(request, response, middleman);
r.doGet(request, response);