@Test
public void testRedirectWithAmpersand() throws Exception
{
HtmlPage firstPage = getWebClient("/navigate").getPage();
HtmlPage secondPage = firstPage.getHtmlElementById("form:redirectWithAmpersand").click();
assertThat(secondPage.getWebResponse().getWebRequest().getHttpMethod(), is(HttpMethod.GET));
assertThat(secondPage.getUrl().toString(), endsWith("/navigate?q=foo%26bar"));
String secondPageContent = secondPage.getWebResponse().getContentAsString();
assertThat(secondPageContent, containsString("Value = [foo&bar]"));
}