### Question:
ParameterSpec implements Serializable { public void redirect(IModel<T> model) { CharSequence url = RequestCycle.get().urlFor( this.pageClass, createParameters(model.getObject()) ); throw new RedirectToUrlException(url.toString(), 302); } ParameterSpec(Class <? extends WebPage> page, String... expressions); ParameterSpec registerParameter(String parameter, String propExpr); BookmarkablePageLink createLink(String id, final IModel<T> model); void redirect(IModel<T> model); PageParameters createParameters(T bean); void parseParameters(PageParameters params, T beanToPopulate); void parseParameters(PageParameters params,
                                T beanToPopulate,
                                boolean throw404OnParseError);  }### Answer:
@Test public void testRedirect() { final ParameterSpec spec = new ParameterSpec<TestBean>(TestPage.class); WicketTestUtils.startComponentWithXHtml(this.tester, new Link("link") { public void onClick() { spec.redirect(Model.of(new TestBean())); } }, "<a wicket:id=\"link\">link</a>"); this.tester.clickLink("link"); this.tester.assertRenderedPage(TestPage.class); }